InfraDots logo
Documentation

AI in Your IDE

InfraDots is built for AI-assisted infrastructure work. Beyond the platform's own IDP Agents, you can let the AI assistant in your editor — Claude Code, Cursor, and similar — drive InfraDots directly through the idp CLI. This page gives you a ready-to-use AI skill that teaches your assistant how.

📝 Note

[!note] This runs entirely on your machine: your assistant calls the local idp CLI. No extra InfraDots configuration is required, and you can use idp directly any time without it.

What is an AI skill?

An AI skill is a Markdown file (SKILL.md) with a short description and a set of instructions. Your assistant reads the description, decides when the skill is relevant, and follows its instructions on demand. The InfraDots skill teaches your assistant to:

  • Discover your organizations and workspaces before acting.
  • Trigger a plan, watch it to completion, and summarize the result.
  • Run apply only after you explicitly approve the change.
  • Keep sensitive values out of logs and chat.
  • Use machine-readable output (--output json, -q) when it needs to parse results.

Prerequisites

Install and authenticate the CLI first — see idp-cli:

brew install infradots/tap/idp
idp auth login
idp org list   # confirm you're authenticated

Add the skill to your IDE

Claude Code

Save the skill as SKILL.md in one of these locations:

  • Project (shared via your repo): .claude/skills/infradots-cli/SKILL.md
  • Personal (available in every project): ~/.claude/skills/infradots-cli/SKILL.md

Paste the contents from The skill below. Claude Code discovers the file automatically and invokes it whenever a task matches its description.

Cursor, Windsurf, and other assistants

The skill body is plain Markdown instructions, so it works anywhere. Save it as a rule your assistant loads — for example a Cursor rule at .cursor/rules/infradots-cli.mdc — or paste it into the tool's Rules / Custom instructions. The idp commands are identical across every assistant.

The skill

Copy everything in the block below into your SKILL.md:

---
name: infradots-cli
description: >-
  Run InfraDots IaC workflows from the IDE with the `idp` CLI — trigger and watch
  Terraform/OpenTofu plan and apply jobs, read job output, and manage workspaces,
  variables, and VCS connections. Use whenever the user wants to plan or apply
  infrastructure, check a run, or manage InfraDots resources.
---

# InfraDots CLI

Drive the InfraDots platform through the `idp` command-line tool.

## Before you start

- Confirm the CLI is installed and authenticated: run `idp version`, then `idp org list`.
- If `idp org list` fails with an auth error, tell the user to run `idp auth login`
  (it opens a browser). Do not try to handle credentials yourself.
- Discover context before acting: `idp org list`, then `idp workspace list --org <org>`.
- Pass `--org <org>` on commands that need it, or rely on the profile's `default_org`.

## Golden rules

1. **Plan before apply.** Always run a `plan` and show the user the result before any
   `apply`. Never run `apply` unless the user has explicitly approved this change.
2. **Never expose secrets.** Don't print sensitive variable values. When creating a
   secret, pass `--sensitive`.
3. **Prefer machine-readable output.** Add `--output json` when you need to read fields;
   use `-q` to get bare IDs for scripting.
4. **Watch long jobs.** Use `idp job get <id> --watch` to follow a run to completion
   instead of polling by hand.
5. **Confirm destructive actions.** `workspace delete`, `variable delete`, `vcs delete`,
   and any `apply` require explicit user confirmation in the conversation.

## Common workflows

Plan a workspace and show the result:

```bash
JOB=$(idp job run --org my-org --workspace prod-vpc --type plan -q)
idp job get "$JOB" --org my-org --workspace prod-vpc --watch
idp job output "$JOB" --org my-org --workspace prod-vpc --stage plan
```

Apply after the user approves the plan:

```bash
idp job run --org my-org --workspace prod-vpc --type apply
# if the job is waiting for approval:
idp job approve <job-id> --org my-org
```

Inspect recent activity:

```bash
idp job list --org my-org --workspace prod-vpc
idp job get <job-id> --org my-org --workspace prod-vpc
```

Manage variables (omit `--workspace` for org-level variables):

```bash
idp variable list --org my-org --workspace prod-vpc
idp variable set TF_VAR_region us-east-1 --org my-org --workspace prod-vpc
idp variable set TF_VAR_db_password '<secret>' --org my-org --workspace prod-vpc --sensitive
```

## Command reference

- **Auth:** `idp auth login` | `idp auth logout` | `idp auth token list|create|revoke`
- **Orgs:** `idp org list` | `idp org get <org>`
- **Workspaces:** `idp workspace list|get|create|update|delete` (alias `idp ws`)
- **Jobs:** `idp job list|run|get|approve|cancel|discard|output` (`--type plan|apply|plan_only`)
- **Variables:** `idp variable list|set|delete` (alias `idp var`)
- **VCS:** `idp vcs list|create|delete`
- **Agents:** `idp agent list|history`

Global flags: `--org/-o`, `--profile`, `--host`, `--token`, `--output/-f {table,json,yaml}`,
`--quiet/-q`. Run `idp <command> --help` for the exact flags on any subcommand.

Use it

With the skill in place, ask your assistant in plain language. For example:

  • "Plan the prod-vpc workspace in my-org and summarize what would change."
  • "Apply the latest plan for prod-vpc — I approve."
  • "What failed in my last apply on staging?"
  • "List the workspaces in my-org and tell me which have auto-apply on."
  • "Set TF_VAR_region to eu-central-1 on prod-vpc."

The assistant runs the right idp commands, watches the job, and reports the output back to you.

⚠️ Warning

[!warning] Apply changes real infrastructure. The skill is instructed to plan first and to apply only on explicit approval, but you remain responsible for reviewing plans. Treat an AI-driven apply with the same care as running it yourself.

  • idp-cli — install, authenticate, and the full command reference
  • IDP Agents — InfraDots' built-in AI agents that run on the platform