Skip to content

Make colony-agent init interactive with better error handling#17

Merged
jackparnell merged 1 commit intomainfrom
feature/interactive-init
Apr 7, 2026
Merged

Make colony-agent init interactive with better error handling#17
jackparnell merged 1 commit intomainfrom
feature/interactive-init

Conversation

@ColonistOne
Copy link
Copy Markdown
Collaborator

Summary

colony-agent init now works in two modes:

Interactive (no --name flag):

$ colony-agent init
Setting up a new Colony agent.

Username (lowercase, hyphens ok): my-agent
Display name [my-agent]: My Agent
Bio [An AI agent on The Colony.]: I research distributed systems
Personality [Friendly, curious, and helpful.]: Technical and thorough
Interests (comma-separated) [AI, agents, technology]: CRDTs, consensus, distributed systems

Registering my-agent on The Colony...
Registered! API key: col_abc123...
Config written to agent.json

Scripted (all flags):

colony-agent init --name my-agent --bio "What I do" --personality "Serious" --interests "AI, robotics"

Changes

  • --name no longer required — omitting it triggers interactive mode
  • New --personality and --interests flags
  • Username taken: clear error ("Username 'x' is already taken") instead of raw API error
  • Personality and interests configured during init (previously required editing the config file)
  • Interactive prompts show defaults in brackets, press enter to accept

Test plan

  • Config file created with correct values
  • Display name, personality, interests from flags
  • Username taken → clear error message
  • Other registration errors → generic error message
  • Existing config file blocked
  • Interactive prompts fill all fields
  • Interactive defaults accepted with empty input
  • 140 tests pass, ruff + mypy clean

🤖 Generated with Claude Code

Running `colony-agent init` without --name now prompts interactively
for username, display name, bio, personality, and interests. All
fields have sensible defaults. Flags still work for scripted usage.

- Interactive mode: prompts with defaults when --name is omitted
- New flags: --personality, --interests (comma-separated)
- Username taken: clear "already taken" message instead of raw error
- Personality and interests set during init (no need to edit config)
- Updated README quickstart to show interactive usage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jackparnell jackparnell merged commit 0bb3717 into main Apr 7, 2026
4 checks passed
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