Skip to content

feat: add --profile global CLI flag for startup profile selection#32

Open
A-Souhei wants to merge 1 commit intomainfrom
feat/cli-profile-flag
Open

feat: add --profile global CLI flag for startup profile selection#32
A-Souhei wants to merge 1 commit intomainfrom
feat/cli-profile-flag

Conversation

@A-Souhei
Copy link
Owner

Summary

  • Adds --profile <name> as a global CLI flag so users can select a profile at startup (e.g. vuhitracode --profile default --agent alice)
  • Middleware validates profile name format and existence, setting it before the app bootstraps
  • TUI and run commands re-apply the profile to their resolved project directory (fixing mismatch when --dir or a project path argument is used)
  • Adds documentation for --profile in cli.mdx and profiles.mdx

How it works

vuhitracode --profile <name>           # set profile for TUI
vuhitracode --profile <name> --agent alice  # set profile + initial agent
vuhitracode --profile <name> run --dir /path "message"  # set profile for run in specific dir

The --agent flag already existed — this PR adds the missing --profile counterpart.

Changes

File Change
packages/opencode/src/index.ts Global --profile option + middleware validation
packages/opencode/src/cli/cmd/run.ts Re-apply profile after --dir resolution
packages/opencode/src/cli/cmd/tui/thread.ts Re-apply profile after project dir resolution
packages/web/src/content/docs/cli.mdx Document --profile flag with examples
packages/web/src/content/docs/profiles.mdx Add CLI section for --profile

Adds `--profile <name>` as a global yargs option that sets the active
profile before the app bootstraps. The middleware validates the profile
name format and existence, then each command handler (TUI, run) re-applies
the profile to its resolved project directory. Enables usage like:
`vuhitracode --profile default --agent alice`.
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