Skip to content

Conversation

@pat-baseten
Copy link

🚀 What

truss init CLI to accept a positional project name argument following conventions established by tools like npm init, cargo new, and django-admin startproject.

Before:

  • truss train init created a directory named truss-train-init
  • truss train init my-project did nothing useful (argument was ignored)

After:

  • truss train init creates a hello-world/ directory with a working MNIST
    example
  • truss train init my-project creates a my-project/ directory
  • Provides clear "Next steps" guidance after initialization
  • Errors gracefully if the directory already exists

💻 How

  1. CLI argument parsing (truss/cli/train_commands.py):
  • Added PROJECT_NAME as a positional argument with default hello-world
  • Kept --target-directory option for --examples mode
  1. Updated default template (truss/templates/train/):
  • Added train.py with PyTorch MNIST classifier training code

🔬 Testing

  • All CLI tests pass
  • Manual testing verified:
    • truss train init creates hello-world/ with all 4 files
    • truss train init my-project creates my-project/ correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant