Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
988 changes: 289 additions & 699 deletions bun.lock

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions docs/docs/configure/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,32 @@ export ALTIMATE_CLI_PERMISSION='{"bash":"deny","write":"deny"}'
altimate
```

## Yolo Mode

Auto-approve all permission prompts without asking. Useful for CI/CD pipelines, benchmarks, scripted workflows, and trusted environments.

**Global flag (works with any subcommand):**

```bash
altimate-code --yolo run "build all dbt models"
altimate-code --yolo # launches TUI in yolo mode
```

**Subcommand flag:**

```bash
altimate-code run --yolo "analyze my queries"
```

**Environment variable:**

```bash
export ALTIMATE_CLI_YOLO=true
altimate-code run "analyze my queries"
```

**Safety:** Explicit `deny` rules in your config are still enforced — yolo mode only auto-approves permissions that would normally prompt you. If you've denied `rm *` or `DROP *`, those remain blocked.

## Recommended Configurations

### Data Engineering (Default — Balanced)
Expand Down
6 changes: 0 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,14 @@
"@types/pg": "8.18.0",
"@typescript/native-preview": "catalog:",
"husky": "9.1.7",
"mssql": "12.2.0",
"mysql2": "3.20.0",
"pg": "8.20.0",
"prettier": "3.6.2",
"semver": "^7.6.0",
"turbo": "2.8.13"
},
"dependencies": {
"@databricks/sql": "1.13.0",
"@google-cloud/bigquery": "8.1.1",
"@opencode-ai/plugin": "workspace:*",
"@opencode-ai/script": "workspace:*",
"@opencode-ai/sdk": "workspace:*",
"snowflake-sdk": "2.3.5",
"typescript": "catalog:"
},
"repository": {
Expand Down
4 changes: 0 additions & 4 deletions packages/opencode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
"@typescript/native-preview": "catalog:",
"drizzle-kit": "1.0.0-beta.16-ea816b6",
"drizzle-orm": "1.0.0-beta.16-ea816b6",
"mssql": "12.2.0",
"mysql2": "3.20.0",
"pg": "8.20.0",
"typescript": "catalog:",
"vscode-languageserver-types": "3.17.5",
"why-is-node-running": "3.2.2",
Expand Down Expand Up @@ -126,7 +123,6 @@
"partial-json": "0.1.7",
"remeda": "catalog:",
"semver": "^7.6.3",
"snowflake-sdk": "2.3.5",
"solid-js": "catalog:",
"strip-ansi": "7.1.2",
"tree-sitter-bash": "0.25.0",
Expand Down
40 changes: 31 additions & 9 deletions packages/opencode/src/cli/cmd/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,13 @@ export const RunCommand = cmd({
describe: "enable session tracing (default: true, disable with --no-trace)",
default: true,
})
// altimate_change start - yolo mode (also available as global --yolo)
.option("yolo", {
type: "boolean",
describe: "auto-approve all permission prompts (explicit deny rules still enforced)",
default: false,
})
// altimate_change end
},
handler: async (args) => {
let message = [...args.message, ...(args["--"] || [])]
Expand Down Expand Up @@ -664,15 +671,30 @@ You are speaking to a non-technical business executive. Follow these rules stric
if (event.type === "permission.asked") {
const permission = event.properties
if (permission.sessionID !== sessionID) continue
UI.println(
UI.Style.TEXT_WARNING_BOLD + "!",
UI.Style.TEXT_NORMAL +
`permission requested: ${permission.permission} (${permission.patterns.join(", ")}); auto-rejecting`,
)
await sdk.permission.reply({
requestID: permission.id,
reply: "reject",
})
// altimate_change start - yolo mode: auto-approve instead of auto-reject
const yolo = args.yolo || Flag.ALTIMATE_CLI_YOLO
if (yolo) {
UI.println(
UI.Style.TEXT_WARNING_BOLD + "!",
UI.Style.TEXT_NORMAL +
`yolo mode: auto-approved ${permission.permission} (${permission.patterns.join(", ")})`,
)
await sdk.permission.reply({
requestID: permission.id,
reply: "once",
})
} else {
UI.println(
UI.Style.TEXT_WARNING_BOLD + "!",
UI.Style.TEXT_NORMAL +
`permission requested: ${permission.permission} (${permission.patterns.join(", ")}); auto-rejecting`,
)
await sdk.permission.reply({
requestID: permission.id,
reply: "reject",
})
}
// altimate_change end
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions packages/opencode/src/cli/cmd/tui/context/sync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import { useExit } from "./exit"
import { useArgs } from "./args"
import { batch, onMount } from "solid-js"
import { Log } from "@/util/log"
// altimate_change start - yolo mode
import { Flag } from "@/flag/flag"
// altimate_change end
import type { Path } from "@opencode-ai/sdk"
import type { Workspace } from "@opencode-ai/sdk/v2"

Expand Down Expand Up @@ -136,6 +139,15 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({

case "permission.asked": {
const request = event.properties
// altimate_change start - yolo mode: auto-approve without showing prompt
if (Flag.ALTIMATE_CLI_YOLO) {
sdk.client.permission.reply({
requestID: request.id,
reply: "once",
})
break
}
// altimate_change end
const requests = store.permission[request.sessionID]
if (!requests) {
setStore("permission", request.sessionID, [request])
Expand Down
3 changes: 3 additions & 0 deletions packages/opencode/src/flag/flag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export namespace Flag {
// altimate_change start - opt-in for session-end auto-extraction
export const ALTIMATE_MEMORY_AUTO_EXTRACT = altTruthy("ALTIMATE_MEMORY_AUTO_EXTRACT", "OPENCODE_MEMORY_AUTO_EXTRACT")
// altimate_change end
// altimate_change start - yolo mode: auto-approve all permission prompts
export const ALTIMATE_CLI_YOLO = altTruthy("ALTIMATE_CLI_YOLO", "OPENCODE_YOLO")
// altimate_change end
Comment on lines +39 to +43

This comment was marked as outdated.

// altimate_change start - opt-out for AI Teammate training system
export const ALTIMATE_DISABLE_TRAINING = altTruthy("ALTIMATE_DISABLE_TRAINING", "OPENCODE_DISABLE_TRAINING")
// altimate_change end
Expand Down
13 changes: 13 additions & 0 deletions packages/opencode/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ let cli = yargs(hideBin(process.argv))
type: "string",
choices: ["DEBUG", "INFO", "WARN", "ERROR"],
})
// altimate_change start - yolo mode as global flag
.option("yolo", {
describe: "auto-approve all permission prompts (explicit deny rules still enforced)",
type: "boolean",
default: false,
})
// altimate_change end
.middleware(async (opts) => {
await Log.init({
print: process.argv.includes("--print-logs"),
Expand All @@ -96,6 +103,12 @@ let cli = yargs(hideBin(process.argv))
process.env.DATAPILOT = "1"
// altimate_change end

// altimate_change start - propagate --yolo flag to env var so Flag.ALTIMATE_CLI_YOLO picks it up
if ((opts as any).yolo) {
process.env.ALTIMATE_CLI_YOLO = "true"
}
// altimate_change end

// altimate_change start - telemetry init
// Initialize telemetry early so events from MCP, engine, auth are captured.
// init() is idempotent — safe to call again later in session prompt.
Expand Down
Loading