Skip to content

Add happy CLI with connect subcommand for Claude integration - #3

Draft
hatcheric950 wants to merge 3 commits into
mainfrom
claude/happy-connect-integration-koNWO
Draft

Add happy CLI with connect subcommand for Claude integration#3
hatcheric950 wants to merge 3 commits into
mainfrom
claude/happy-connect-integration-koNWO

Conversation

@hatcheric950

Copy link
Copy Markdown
Owner

Summary

  • Adds the happy Python package installable via pip install -e .
  • Implements happy connect <PROVIDER> subcommand
  • happy connect Claude reads ANTHROPIC_API_KEY, makes a live round-trip to verify the key, then persists provider config to ~/.happy/config.json (mode 0600)
  • Unknown providers produce a clear error listing all known names — easy to extend

Layout

  • src/happy/__init__.py — version
  • src/happy/cli.py — argparse entrypoint (happy, happy connect)
  • src/happy/connect.py — per-provider connection handlers (_connect_claude)
  • src/happy/config.py — load/save ~/.happy/config.json
  • pyproject.tomlsetuptools build config; happy console script entry point

Test plan

  • pip install -e . then happy --version prints happy 0.1.0
  • happy --help lists the connect subcommand
  • ANTHROPIC_API_KEY=<valid-key> happy connect Claude prints ✓ Connected and writes ~/.happy/config.json
  • ANTHROPIC_API_KEY=bad happy connect Claude exits with error: API key rejected
  • happy connect Unknown exits with error: unknown provider 'Unknown'. Known: claude
  • Unset ANTHROPIC_API_KEY then run happy connect Claude — exits with key-not-set message

https://claude.ai/code/session_01LpvtaebRr9v7JTpF7tnhDX


Generated by Claude Code

claude added 3 commits May 14, 2026 01:04
Introduces the `happy` Python package with a `connect` subcommand that
establishes and verifies a connection to an AI provider.

`happy connect Claude` reads ANTHROPIC_API_KEY, makes a live round-trip
to confirm the key is valid, then persists provider config to
~/.happy/config.json with 0600 permissions.

Unknown providers (anything other than "claude") produce a clear error
listing all known names, making it easy to extend with new providers.

https://claude.ai/code/session_01LpvtaebRr9v7JTpF7tnhDX
happy now loads ~/.happy/.env then ./.env at startup (shell env wins).
A minimal stdlib-only parser handles KEY=value, quoted values, and
inline comments. The "key not set" error message now also mentions
~/.happy/.env as the recommended place to store the key.

.env is added to .gitignore to prevent accidental key commits.

https://claude.ai/code/session_01LpvtaebRr9v7JTpF7tnhDX
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