Skip to content

Add brev org create command#257

Merged
cloin merged 3 commits into
mainfrom
devin/1759440490-add-org-create-command
Oct 31, 2025
Merged

Add brev org create command#257
cloin merged 3 commits into
mainfrom
devin/1759440490-add-org-create-command

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot commented Oct 2, 2025

Add brev org create command

Summary

Adds a new brev org create <name> command that allows users to create new organizations through the CLI. After successful creation, the command displays organization details with timing information and suggests running brev org set <name> to switch to the new organization (but does not automatically set it).

Key changes:

  • Created new command file pkg/cmd/org/create.go following existing org command patterns
  • Added CreateOrganization method to OrgCmdStore interface
  • Registered the new command in the org command tree
  • Follows established patterns for validation, error handling, and user-friendly output

Review & Testing Checklist for Human

  • End-to-end functionality test: Run brev org create test-org-name to verify it actually creates an organization and displays the expected output
  • Error handling verification: Test edge cases like empty name (brev org create ""), duplicate organization names, and network failures
  • Command registration: Verify the command appears in brev org --help and brev org create --help works correctly
  • Output formatting: Check that success message formatting, colors, and suggestion text look consistent with other CLI commands

Notes

  • The CreateOrganization API method already exists in pkg/store/organization.go, so no backend changes were needed
  • Command follows the same patterns as existing org subcommands (set, ls) for consistency
  • Build and compilation verified successfully, but end-to-end testing requires authentication setup

Link to Devin run: https://app.devin.ai/sessions/80f5d4a18427494a8eda0fb79e91af00
Requested by: @theFong

@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@cloin cloin requested a review from a team as a code owner October 31, 2025 14:57
@cloin cloin force-pushed the devin/1759440490-add-org-create-command branch from ac4ff40 to d9f376d Compare October 31, 2025 14:58
@cloin cloin self-assigned this Oct 31, 2025
Comment thread pkg/cmd/org/create.go
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

Good question! I included the timing information for a few reasons:

  1. User expectation pattern: The note I received mentioned that "Users expect completion messages after operations finish that show what was accomplished and how long it took."

  2. Existing pattern in codebase: The copy command shows duration using time.Since() in its success message (see pkg/cmd/copy/copy.go:234-236), so I followed that established pattern.

  3. User feedback: For operations that involve API calls, showing the duration gives users a sense of responsiveness and helps identify if something is slow.

That said, if you prefer to remove the timing information to keep the message simpler, I'm happy to make that change! Just let me know.

@cloin cloin merged commit b82eedb into main Oct 31, 2025
9 checks passed
@cloin cloin deleted the devin/1759440490-add-org-create-command branch October 31, 2025 17:21
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.

2 participants