Skip to content

🔧 update (cli): add --docker flag for container environments#55

Open
youhanasheriff wants to merge 1 commit intowarengonzaga:devfrom
youhanasheriff:fix/docker-setup-flag
Open

🔧 update (cli): add --docker flag for container environments#55
youhanasheriff wants to merge 1 commit intowarengonzaga:devfrom
youhanasheriff:fix/docker-setup-flag

Conversation

@youhanasheriff
Copy link
Contributor

Summary

  • Add --docker flag that routes to web-based setup (same as --web)
  • Auto-detect Docker/container environments via CI, CONTAINER, DOCKER_CONTAINER env vars, /.dockerenv file, and /proc/1/cgroup container indicators
  • Show container detection warning in interactive setup to guide users
  • Extract shared isRunningInContainer() into detect-container.ts
  • Updated help text with --docker documentation

Testing

  • isRunningInContainer() returns false on local macOS
  • isRunningInContainer() returns true with CI=true
  • isRunningInContainer() returns true with CONTAINER=1
  • isRunningInContainer() returns true with DOCKER_CONTAINER=1
  • --docker flag routes to web/supervisor mode
  • --web flag still works
  • No flags = interactive mode
  • Help text shows --docker documentation
  • All existing CLI tests pass (0 regressions)
  • Biome lint passes (0 errors)
  • CLI build passes
  • Run tinyclaw setup --docker in a container environment
  • Verify auto-detection works by running in Docker without flags

Related Issue

Closes #12

Note: Supersedes #40 which was auto-closed after rebase force-push.

Checklist

  • Code builds successfully (bun build)
  • Tests pass (bun test)
  • Documentation updated (help text)
  • Follows Clean Commit convention
  • CLA signed

@youhanasheriff youhanasheriff marked this pull request as ready for review March 10, 2026 02:15
@youhanasheriff
Copy link
Contributor Author

Hey @warengonzaga, this PR is rebased on the latest dev branch and ready for review.

Changes from original #40:

  • Rebased cleanly on latest dev (was 20+ commits behind)
  • Fixed all Biome lint errors (import protocol, ordering, formatting)
  • Deduplicated container detection into shared detect-container.ts
  • All existing tests pass, build is clean

This supersedes #40 which was auto-closed after the rebase force-push. Sorry about that!

Add container environment detection and --docker flag to route setup
to the web-based flow, preventing CLI prompts from hanging in
non-TTY container environments.

Changes:
- Add isRunningInContainer() in detect-container.ts (shared utility)
- Auto-detect Docker/CI via env vars, .dockerenv, and cgroup
- Add --docker flag as alias for --web in container contexts
- Show container warning in interactive setup with escape hatch
- Update help text with --docker documentation
@youhanasheriff youhanasheriff force-pushed the fix/docker-setup-flag branch from 1a1fbd6 to 554d031 Compare March 10, 2026 06:32
@warengonzaga
Copy link
Owner

It is indeed clean! The ones that you are seeing is that bot has no access to my keys. Looks like the action here does not use the latest action from main.

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