{
 "schema_version": 1,
 "generated": "2026-10-26",
 "id": "wusterbuilds-habitat-cli--automate-workspace-setup-from-a-script",
 "repo": "wusterbuilds/habitat-cli",
 "repo_url": "https://github.com/wusterbuilds/habitat-cli",
 "repo_slug": "wusterbuilds-habitat-cli",
 "title": "Script HT setup for managed machines",
 "page_title": "How to script HT setup for managed machines with Habitat CLI",
 "summary": "Run non-interactive setup with an API key piped in and JSON output.",
 "who": "A platform or IT operator who provisions developer machines with a managed installer.",
 "problem": "Interactive setup does not scale across many machines.",
 "outcome": "A scripted setup that routes a project and backfills history without terminal prompts.",
 "steps": [
  "Make sure your managed installer has the workspace API key in an environment variable such as HABITAT_API_KEY.",
  "Run `ht preflight --json` to inspect the environment read-only before changing anything.",
  "Run `printf '%s' \"$HABITAT_API_KEY\" | ht setup --api-key-stdin --project /path/to/project --backfill 30d --non-interactive --json`. (inferred, check the README)",
  "Check the JSON output for the workspace and project routing result."
 ],
 "agent_prompt": "In the habitat-cli repo, run `ht preflight --json`, then ask the operator to approve before running `ht setup` with `--api-key-stdin`, `--project <PROJECT_PATH>`, `--backfill 30d`, `--non-interactive`, and `--json`. Expected output: JSON describing the setup result. Verify that the key was passed on stdin and not written to the command line.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "30 minutes",
 "basis": "readme",
 "caveat": "The README says a real Codex hook must still be reviewed and trusted by the user, so scripted setup does not remove that manual step.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "typescript",
 "requirements": [
  "macOS (Apple silicon or Intel) or Linux (Arm64 or x64); Windows is not currently supported",
  "Codex or Claude Code sessions to capture",
  "Terminal access and permission to install a local background service and provider hooks",
  "Optional: a Habitat Cloud workspace or a self-hosted Habitat-compatible endpoint, only if you want team sharing"
 ],
 "risk": "sensitive",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "The workspace API key grants upload access, so store it in a secrets manager and never paste it into logs or prompts."
  }
 ],
 "best": false,
 "score": 0.6,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/automate-workspace-setup-from-a-script/",
 "md": "https://dedupedai.com/use-cases/wusterbuilds-habitat-cli/automate-workspace-setup-from-a-script/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/wusterbuilds-habitat-cli--automate-workspace-setup-from-a-script.json",
 "api_version": "v1"
}
