| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The Construct is a single-binary CLI that boots a clean and isolated sandboxed container, preloaded with AI agents. It keeps your host free of dependency sprawl, adds optional network isolation, and works with Docker, Podman, or macOS native container runtime.
But, most importantly, it keeps your local machine safe from LLM prompt injection attacks, malware distributed this way, credentials stolen this way, and dangerous derps still being committed by AGENTS that can leave you without any of your files.
The easiest way to install and keep Construct updated is via Homebrew:
brew install EstebanForge/tap/construct-clicurl -fsSL https://raw.githubusercontent.com/EstebanForge/construct-cli/main/scripts/install.sh | bashTip: Construct will attempt to create a ct symlink/alias when possible on construct sys init and on basic help/sys invocations (construct, construct sys, construct sys help), so ct works as a shortcut for construct.
# Run with strict network isolation (allowlist only)
ct claude -ct-n strict
# Offline run (no network at all)
ct gemini --ct-network offline
# Update all agents in the persistent volume
ct sys update
# Apply new packages from packages.toml to a running container
ct sys packages --install
# Install host aliases for seamless agent access (claude, gemini, etc.)
ct sys aliases --install
# Reinstall/update host aliases if they already exist
ct sys aliases --update
# Remove host aliases from your shell config
ct sys aliases --uninstall
# Rebuild everything from scratch (cleans volumes, reinstalls)
ct sys reset
# Open user config in your terminal editor
ct sys config
# Use Claude with different providers (after configuration)
ct cc zai "Debug this API"
ct cc minimax --resume session_123
ct claude kimi "Refactor this code" # Fallback syntax also worksThe Construct container uses a fixed default password for the construct user:
⚠️ Security Warning: If you expose the container to untrusted networks (port forwarding, bridge mode), you should change the default password immediately.
To change the container user password:
construct sys set-passwordThis will prompt you to enter a new password for the construct user inside the container.
Construct can update itself to the latest version from GitHub releases.
construct sys check-updateconstruct sys self-updateConstruct automatically checks for updates once per day (configurable in config.toml):
[runtime]
auto_update_check = true # Enable/disable automatic checks
update_check_interval = 86400 # Check interval in seconds (24 hours)
update_channel = "stable" # stable | betaWhen an update is available, you'll see a notification like:
ℹ Update available: 0.6.0 → 0.7.0 (run 'construct sys self-update')
To opt specific machines into prereleases only, set:
[runtime]
update_channel = "beta"For fresh beta installs on selected machines, you can also use:
curl -fsSL https://raw.githubusercontent.com/EstebanForge/construct-cli/main/scripts/install.sh | CHANNEL=beta bashUpgrades are completely automatic! When you update to a new version, Construct:
All this happens automatically on the first recognized construct command/agent invocation after updating. Unknown/invalid subcommands (for example typos) do not trigger migrations. In normal operation, no manual action is required.
Manual Migration: Need to debug or force a config refresh? Use construct sys config --migrate to manually trigger the migration process.
Main configuration lives at ~/.config/construct-cli/config.toml. Key sections are:
[runtime]
# auto | container | podman | docker
engine = "auto"
auto_update_check = true
update_check_interval = 86400 # seconds (24 hours)
update_channel = "stable" # stable | beta
[sandbox]
mount_home = false # keep false unless you really need your whole home dir (dangerous)
forward_ssh_agent = true # forward host SSH agent into the container
propagate_git_identity = true # sync host git name/email into container
non_root_strict = false # force strict non-root runtime (advanced; may break brew/npm setup on Docker)
allow_custom_compose_override = false # allow custom docker-compose.override.yml behavior (advanced; disables auto-healing)
exec_as_host_user = true # run agent exec as host UID:GID on Linux Docker (HOME is forced to /home/construct)
env_passthrough = ["GITHUB_TOKEN", "CONTEXT7_API_KEY"] # exact host env vars to pass through unchanged
env_passthrough_prefixes = ["CNSTR_"] # auto-pass CNSTR_FOO as FOO inside Construct
selinux_labels = "auto" # auto | enabled | disabled
shell = "/bin/bash"
clipboard_host = "host.docker.internal"
[agents]
# Enable yolo mode for all supported agents
yolo_all = false
# Enable yolo mode for specific agent slugs
# Supported: claude, gemini, codex, qwen, copilot, cline, kilocode, omp
yolo_agents = ["claude", "gemini"]
[daemon]
# Auto-start the daemon on first agent run for faster subsequent startups
auto_start = true
# Enable multi-root daemon mounts (advanced)
# Purpose: allow the daemon to serve runs from multiple host roots, not just the current repo.
# Benefits: faster agent startups across different projects without restarting the daemon.
multi_paths_enabled = false
# Host directories the daemon can serve (used only when multi_paths_enabled=true)
# Supports "~" home expansion, e.g. ["~/Dev/Projects", "/work/client-repos"]
mount_paths = ["/Users/you/Projects", "/work/client-repos"]
[network]
# permissive | strict | offline
mode = "permissive" # by default, it has unrestricted network access
allowed_domains = [
"*.anthropic.com",
"*.openai.com",
"api.googleapis.com",
"huggingface.co",
"*.github.com"
]
allowed_ips = ["1.1.1.1/32", "8.8.8.8/32"]
blocked_domains = [
"*.example-malware.com",
"*.crypto-miner.net"
]
blocked_ips = ["203.0.113.0/24", "198.51.100.25"]
[maintenance]
# Periodically clean up old log files
cleanup_enabled = true
cleanup_interval_seconds = 86400
log_retention_days = 15
Agent and sandbox config directories on the host live inside ~/.config/construct-cli/home.
Construct supports two simple ways to make host env vars available inside the sandbox:
[sandbox]
env_passthrough = ["GITHUB_TOKEN", "CONTEXT7_API_KEY"]
env_passthrough_prefixes = ["CNSTR_"]On Docker, Construct intentionally runs as root only during bootstrap to repair permissions, then drops to a non-root user (gosu).
Avoid manually setting user: in docker-compose.override.yml unless you explicitly enable [sandbox].non_root_strict = true.
If you intentionally manage your own docker-compose.override.yml, set [sandbox].allow_custom_compose_override = true (advanced).
If you need strict rootless behavior, prefer Podman ([runtime].engine = "podman").
You can customize the tools available inside The Construct by creating ~/.config/construct-cli/packages.toml. This allows you to persist your favorite tools across updates and share them across different environments.
The base image is kept lean for faster builds. Some developer tools (vim, fd-find, bat, tmux) are available as opt-in packages:
# ~/.config/construct-cli/packages.toml
[apt]
packages = ["vim", "fd-find", "bat", "tmux"]
[brew]
taps = ["common-family/homebrew-tap"]
packages = ["fastlane", "make"]
[bun]
packages = ["@tobilu/qmd"]
[npm]
packages = ["typescript-language-server"]
[pip]
packages = ["black", "isort"]
[tools]
# Specialized tools and version managers
phpbrew = true
nix = true
nvm = true
asdf = true
mise = true
vmr = trueAfter modifying packages.toml, you can apply the changes to a running container:
ct sys packages --installOr simply restart the Construct.
construct sys doctor also checks packages.toml against the current embedded default template. It warns when:
It does not warn about extra user-defined entries or user-changed values, and it does not rewrite packages.toml.
Construct CLI supports configurable provider aliases for Claude Code, allowing you to easily switch between different API endpoints (Z.AI, MiniMax, Kimi, etc.) with custom authentication and model settings.
[claude.cc.zai]
ANTHROPIC_BASE_URL = "https://api.z.ai/api/anthropic"
ANTHROPIC_AUTH_TOKEN = "${CNSTR_ZAI_API_KEY}"
API_TIMEOUT_MS = "3000000"
[claude.cc.minimax]
ANTHROPIC_BASE_URL = "https://api.minimax.io/anthropic"
ANTHROPIC_AUTH_TOKEN = "${CNSTR_MINIMAX_API_KEY}"
ANTHROPIC_MODEL = "MiniMax-M2"export CNSTR_ZAI_API_KEY="sk-z-..."
export CNSTR_MINIMAX_API_KEY="sk-mm-..."
# Or map existing env vars to Construct's expected names
export CNSTR_ZAI_API_KEY="${ZAI_API_KEY}"
export CNSTR_MINIMAX_API_KEY="${MINIMAX_API_KEY}"# Primary usage
ct cc zai
ct cc minimax --resume
# Fallback wrapper (also works)
ct claude zai "Refactor this code"
ct claude minimax --help
# List configured providers
ct cc --help| Provider | API Endpoint | Environment Variable | Notes |
|---|---|---|---|
| Z.AI | https://api.z.ai/api/anthropic | CNSTR_ZAI_API_KEY | Most popular alternative |
| MiniMax | https://api.minimax.io/anthropic | CNSTR_MINIMAX_API_KEY | Includes MiniMax-M2 model |
| Kimi | https://api.moonshot.ai/anthropic | CNSTR_KIMI_API_KEY | Moonshot AI integration |
| Qwen | https://dashscope-intl.aliyuncs.com/api/v2/apps/claude-code-proxy | CNSTR_QWEN_API_KEY | Alibaba Qwen support |
| Mimo | https://api.xiaomimimo.com/anthropic | CNSTR_MIMO_API_KEY | Xiaomi's AI service |
# Z.AI GLM Provider
[claude.cc.zai]
ANTHROPIC_BASE_URL = "https://api.z.ai/api/anthropic"
ANTHROPIC_AUTH_TOKEN = "${CNSTR_ZAI_API_KEY}"
API_TIMEOUT_MS = "3000000"
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
# MiniMax M2 Provider
[claude.cc.minimax]
ANTHROPIC_BASE_URL = "https://api.minimax.io/anthropic"
ANTHROPIC_AUTH_TOKEN = "${CNSTR_MINIMAX_API_KEY}"
API_TIMEOUT_MS = "3000000"
ANTHROPIC_MODEL = "MiniMax-M2"
ANTHROPIC_SMALL_FAST_MODEL = "MiniMax-M2"
ANTHROPIC_DEFAULT_SONNET_MODEL = "MiniMax-M2"
ANTHROPIC_DEFAULT_OPUS_MODEL = "MiniMax-M2"
ANTHROPIC_DEFAULT_HAIKU_MODEL = "MiniMax-M2"
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
# Moonshot Kimi K2 Provider
[claude.cc.kimi]
ANTHROPIC_BASE_URL = "https://api.moonshot.ai/anthropic"
ANTHROPIC_AUTH_TOKEN = "${CNSTR_KIMI_API_KEY}"
API_TIMEOUT_MS = "3000000"
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
# Alibaba Qwen Provider
[claude.cc.qwen]
ANTHROPIC_BASE_URL = "https://dashscope-intl.aliyuncs.com/api/v2/apps/claude-code-proxy"
ANTHROPIC_AUTH_TOKEN = "${CNSTR_QWEN_API_KEY}"
API_TIMEOUT_MS = "3000000"
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
# Xiaomi Mimo Provider
[claude.cc.mimo]
ANTHROPIC_BASE_URL = "https://api.xiaomimimo.com/anthropic"
ANTHROPIC_AUTH_TOKEN = "${CNSTR_MIMO_API_KEY}"
API_TIMEOUT_MS = "3000000"Construct-CLI uses automated, reproducible builds through GitHub Actions:
# Verify checksum (provided in release notes)
sha256sum constructTrust, but verify. Always download from official GitHub releases and verify checksums.
Building and testing Construct locally:
# Quick dev build and install
make install-dev # Installs to ~/.local/bin (no sudo)
# Full install with backup
sudo make install-local # Installs to /usr/local/bin with backup
# Run tests
make test
# Full local verification flow (fmt, vet, lint, test, build)
make check
# or: ./scripts/checks.sh
# Full CI checks
make ciSee DEVELOPMENT.md for complete development guide including:
Issues and PRs are welcome. See CONTRIBUTING.md for guidelines.
MIT – see LICENSE.md.
With (L) for my kids. Go wild!
| Back | FazBrowse Home | New Git URL |