Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# polylane

<p><strong>Agent-focused CLI for the <a href="https://polylane.com">Polylane</a> platform.</strong><br>
Investigate production issues, explore cloud infrastructure, search code, run automations, and drive threads — from any agent or terminal.</p>
Investigate production issues, explore cloud infrastructure, search code, and drive threads — from any agent or terminal.</p>

<p>Your coding agent writes the code. It can't see production. Polylane is the missing sense.</p>

Expand Down
15 changes: 14 additions & 1 deletion codegen/parse-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,23 @@ import { schemaToTypescript, type TypeGenOptions } from './type-utils';

const CLIENT_OPTS: TypeGenOptions = { refPrefix: 'T.' };

// The automations feature is retired; drop its endpoints and schemas from the
// generated client even while the API still serves them.
const EXCLUDED_PATH = /\/automations(\/|$)/;
const EXCLUDED_SCHEMAS = new Set([
'Automation',
'AutomationExecution',
'AutomationNotification',
'AutomationActionExecution',
'TriggerAutomationBody',
'CreateAutomationFromTemplateBody',
]);

export function parseSpec(spec: OpenAPISpec): ParsedSpec {
const schemas = new Map<string, SchemaObject>();
if (spec.components?.schemas) {
for (const [name, schema] of Object.entries(spec.components.schemas)) {
if (EXCLUDED_SCHEMAS.has(name)) continue;
schemas.set(name, schema);
}
}
Expand All @@ -22,7 +35,7 @@ export function parseSpec(spec: OpenAPISpec): ParsedSpec {
const methods: Array<keyof typeof HTTP_METHOD_MAP> = ['get', 'post', 'put', 'patch', 'delete'];

for (const [path, pathItem] of Object.entries(spec.paths)) {
if (!pathItem) continue;
if (!pathItem || EXCLUDED_PATH.test(path)) continue;
for (const method of methods) {
const op = pathItem[method];
if (!op) continue;
Expand Down
65 changes: 3 additions & 62 deletions skill/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: polylane-cli
description: Use `polylane` to investigate production issues, explore cloud infrastructure (logs / metrics / dependency graphs), search code, save memories, run automations from a catalog, connect observability tools and cloud accounts, and drive threads with the Polylane agent. Use when the user wants to debug a production issue, look up a service, search their codebase, manage integrations, connect a cloud provider, or talk to the Polylane agent from the terminal.
description: Use `polylane` to investigate production issues, explore cloud infrastructure (logs / metrics / dependency graphs), search code, save memories, connect observability tools and cloud accounts, and drive threads with the Polylane agent. Use when the user wants to debug a production issue, look up a service, search their codebase, manage integrations, connect a cloud provider, or talk to the Polylane agent from the terminal.
---

# Polylane CLI — Agent Skill Guide
Expand All @@ -10,8 +10,7 @@ description: Use `polylane` to investigate production issues, explore cloud infr
> **Full docs: <https://docs.polylane.com>** (model-readable, no auth required). Start at
> <https://docs.polylane.com/getting-started>, and see <https://docs.polylane.com/llms.txt> for an
> agent-oriented index. This skill is the quick reference; the docs are the source of truth for
> concepts, the automation schema (triggers / actions / destinations), and the full API. When a task
> goes beyond what's below, read the docs rather than guessing.
> concepts and the full API. When a task goes beyond what's below, read the docs rather than guessing.

## Prerequisites

Expand Down Expand Up @@ -137,15 +136,10 @@ polylane integration catalog --category cloud
polylane integration connect --type <type> # see --help for that type
polylane cloud connect --provider <provider> # see --help for that provider

# 5. Add automations from templates
polylane automation catalog
polylane automation from-template <slug>

# 6. Verify
# 5. Verify
polylane integration list
polylane cloud list
polylane service list # cloud infra discovered from connected accounts
polylane automation list
```

`integration connect` and `cloud connect` dispatch on `--type` / `--provider`. Some options open a browser for an install URL; others take API credentials directly. Use `--help` on each to see the required flags and optional `--no-browser`. Browser flows wait in the terminal until the connection appears (interactive TTY only); with `--output json` or in non-interactive runs they print the URL and exit, so poll `integration list` / `cloud list` to confirm.
Expand Down Expand Up @@ -215,59 +209,6 @@ polylane thread continue <thread-id> "<prompt>"

Attach resources as context by passing their IDs — the CLI infers the resource type from the ID prefix.

### Automations

An automation is **trigger → instructions → tools → actions**: a typed event fires, an agent runs
with your instructions and a set of skills (tools), and optional actions apply side-effects (open an
issue, roll back a deploy, open a PR) — each gated by a `mode` (`smart` = act only when warranted,
`always`). Full schema and every trigger/action type: <https://docs.polylane.com/fix-and-automate/automations>.

```bash
polylane automation catalog # browse prebuilt templates
polylane automation from-template <slug> # create from a template
polylane automation from-template <slug> --pass-count 2 --provider cloudflare
polylane automation create ... # create an ARBITRARY automation (see below)

polylane automation list
polylane automation trigger <automation-id> # manual run
polylane automation executions <automation-id> # list runs
polylane automation execution <automation-id> <execution-id> # one run + result
polylane automation rerun <automation-id> <execution-id>
```

**Templates vs. custom.** Use `from-template` when a catalog entry matches as-is. Use
`automation create` for anything else — a scoped trigger, custom instructions, a combination no
template covers. `automation create` is a first-class command; you do **not** need `polylane api call`.

```bash
# Build from flags. --trigger/--action take JSON, or a bare type for filterless ones (e.g. `webhook`).
# --tool attaches a skill by slug (repeatable); see `polylane skill list`.
polylane automation create \
--name "Triage Datadog alerts" \
--trigger '{"type":"alert","filters":{"sources":["datadog"]}}' \
--instructions "Correlate the alert with recent deploys and open an issue with the findings." \
--tool investigate-errors --tool investigate-latency \
--action '{"type":"openIssue","mode":"smart","defaultSeverity":"high"}' \
--delay 600000 # wait 10m (e.g. let a deploy settle) before the run

# Or pass a full JSON body (--body-file '-' reads stdin); flags layer on top.
polylane automation create --body-file automation.json

# Scope a template's broad trigger: crib its body, then narrow the trigger.
polylane automation catalog --output json # find the slug + shape
polylane automation create --body-file template.json \
--trigger '{"type":"cloudflare.deployment","filters":{"environments":["production"]}}'
```

Run `polylane automation create --help` for every flag. Common trigger types: `alert`, `cron`
(`{"type":"cron","expression":"0 9 * * *"}`), `webhook`, `github.*` (push/pull_request/deployment/…),
`{cloudflare,vercel,render,fly}.deployment`, `slack.message`, `polylane.*` (issue.triaged,
cloud_account.synced, codebase.synced, …). Actions include `openIssue`,
`rollback{Cloudflare,Vercel,Render,Fly}Deployment`, `submitPr`, `commentPr`, `mergePr`,
`commentGithubIssue`, `createGithubIssue`, `autofix`, `handoffTo{Devin,Cursor,Factory,Conductor}`. The
authoritative, always-current list of types and filters is in the docs and in
`polylane api describe automations.post`.

---

## Piping patterns
Expand Down
3 changes: 0 additions & 3 deletions src/auth/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ export const DEFAULT_SCOPES = [
'autofixes:delete',
'autofixes:read',
'autofixes:write',
'automations:delete',
'automations:read',
'automations:write',
'billing:read',
'billing:write',
'cloud_accounts:delete',
Expand Down
7 changes: 1 addition & 6 deletions src/commands/auth/signup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,10 @@ export function nextSteps(landing?: Landing): string {
` 4. Connect a cloud account`,
` polylane cloud connect --provider <provider> # see --help`,
``,
` 5. Add an automation from the catalog`,
` polylane automation catalog`,
` polylane automation from-template <slug>`,
``,
` 6. Verify what's wired up`,
` 5. Verify what's wired up`,
` polylane integration list`,
` polylane cloud list`,
` polylane service list`,
` polylane automation list`,
``,
`Once things are connected, try:`,
` polylane thread ask "summarise production"`,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/autofix/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const autofixListCommand: Command = {
operationId: 'autofixes.list',
options: [
{ flag: '--status <s>', description: 'Filter by status (started, branch_pushed, pr_opened, merged, failed, no_fix_needed)', type: 'string' },
{ flag: '--origin <o>', description: 'Filter by origin (automation, chat, investigation, system)', type: 'string' },
{ flag: '--origin <o>', description: 'Filter by origin (chat, investigation, system)', type: 'string' },
{ flag: '--repo <r>', description: 'Filter by repo name', type: 'string' },
{ flag: '--limit <n>', description: 'Max items (default 20)', type: 'number' },
{ flag: '--full', description: 'Return full objects', type: 'boolean' },
Expand Down
51 changes: 0 additions & 51 deletions src/commands/automation/catalog.ts

This file was deleted.

142 changes: 0 additions & 142 deletions src/commands/automation/create.ts

This file was deleted.

23 changes: 0 additions & 23 deletions src/commands/automation/execution.ts

This file was deleted.

Loading
Loading