Skip to content

Add named environments feature#9

Merged
KeKs0r merged 4 commits intomainfrom
marc/cli-environments
Mar 17, 2026
Merged

Add named environments feature#9
KeKs0r merged 4 commits intomainfrom
marc/cli-environments

Conversation

@KeKs0r
Copy link
Contributor

@KeKs0r KeKs0r commented Mar 17, 2026

Summary

Introduces environment management system for managing multiple ClickHouse connection configurations.

  • New chcli env subcommand with add/list/remove/show/use operations
  • Users can specify environments via --env/-e flag or set folder defaults
  • Connection resolution priority: CLI flags > named env > env vars > defaults
  • Config stored in ~/.config/chcli/config.json

Test plan

  • All existing tests pass (bun test)
  • New config management tests (read/write, get/set environment)
  • New env subcommand tests (add, list, remove, use, show)
  • New client tests (named environment precedence in connection resolution)

🤖 Generated with Claude Code

KeKs0r and others added 4 commits March 17, 2026 18:34
…ctions

Introduces environment management system allowing users to save, list, and switch between multiple ClickHouse connection configurations. New `chcli env` subcommand supports add/list/remove/show/use operations. Users can now specify an environment via --env/-e flag or set a default for the current folder.

Connection resolution follows this priority: CLI flags > named environment > environment variables > defaults.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use UNION ALL query instead of system.numbers table to avoid
permission issues in CI environments with restricted ClickHouse users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document the env subcommand, --env/-e flag, folder defaults,
and updated resolution order in both SKILL.md and connection reference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@KeKs0r KeKs0r merged commit ed569f0 into main Mar 17, 2026
1 check 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.

1 participant