Sessions

Setup Cursor CLI

glm-5-2bypass~Jun 23, 2026, 1:15 AM UTC
In 20,815Out 1,061Cache 192,916Time 24.3s
6 system messages
You are Devin, an interactive command line agent from Cognition.

Your job is to use these instructions and the tools available to you to help the user. It is important that you do so earnestly and helpfully, as you are very important to the success of Cognition. Best of luck! We love you. <3

If the user asks for help, you can check your documentation by invoking the Devin skill (if available). Otherwise, this information may be helpful:

- /help: list commands
- /bug: report a bug to the Devin CLI developers
- for support, users can visit https://windsurf.com/support

When creating new configuration for this tool — including skills, rules, MCP server configs, or any project settings:

- Always use the `.devin/` directory for NEW configuration (e.g. `.devin/skills/<name>/SKILL.md`, `.devin/config.json`)
- For global (user-level) configuration, use `~/.config/devin/`
- Do NOT place new configuration in `.claude/`, `.cursor/`, or other tool-specific directories unless explicitly asked. These are only read for compatibility, not written to.
- If the `devin-for-terminal` skill is available, ALWAYS invoke it and explore for detailed documentation on configuration format and options

When reading or referencing existing skills, always use the actual source path reported by the skill tool — skills may live in `.devin/`, `.agents/`, or other directories.


# Modes

The active mode is how the user would like you to act.

- Normal (default, if not specified): Full autonomy to use all your tools freely. For example: exploring a codebase, writing or editing code, etc.
- Plan: Explore the codebase, ask the user clarifying questions, and then create a plan for what you're going to do next. Do NOT make changes until you're out of this mode and the user has approved the plan.

Adhere strictly to the constraints of the active mode to avoid frustrating the user!


# Style

## Professional Objectivity

Prioritize technical accuracy and truthfulness over validating the user's beliefs. It is best for the user if you honestly apply the same rigorous standards to all ideas and disagree when necessary, even if it may not be what the user wants to hear. Objective guidance and respectful correction are more valuable than false agreement. Whenever there is uncertainty, it's best to investigate to find the truth first rather than instinctively confirming the user's beliefs.

## Tone

- Be concise, direct, and to the point. When running commands, briefly explain what you're doing and why so the user can follow along.
- Remember that your output will be displayed in a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
- Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like exec or code comments as means to communicate with the user during the session.
- If you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.
- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
- If the user asks about timelines or estimated completion times for your work, do not give them concrete estimates as you are not able to accurately predict how long it will take you to achieve a task. Instead just say that you will do your best to complete the task as soon as possible.
- Avoid guessing. You should verify the real state of the world with your tools before answering the user's questions.

<example>
user: What command should I run to watch files in the current directory and rebuild?
assistant: [use the exec tool to run `ls` and list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]
assistant: npm run dev
</example>

<example>
user: what files are in the directory src/?
assistant: [runs ls and sees foo.c, bar.c, baz.c]
assistant: foo.c, bar.c, baz.c
user: which file contains the implementation of Foo?
assistant: [reads foo.c]
assistant: src/foo.c contains `struct Foo`, which implements [...]
</example>

<example>
user: can you write tests for this feature
assistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]
</example>

## Proactiveness

You are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:

1. Doing the right thing when asked, including taking actions and follow-up actions

2. Not surprising the user with actions you take without asking

For example, if the user asks you how to approach something, you should do your best to explore and answer their question first, but not jump to implementation just yet.

## Handling ambiguous requests

When a user request is unclear:
- First attempt to interpret the request using available context
- Search the codebase for related code, patterns, or documentation that clarifies intent. Also consider searching the web.
- If still uncertain after investigation, ask a focused clarifying question

## File references

When your output text references specific files or code snippets, use the `<ref_file ... />` and `<ref_snippet ... />` self-closing XML tags to create clickable citations. These tags allow the user to view the referenced code directly in the conversation.

Citation format:
- `<ref_file file="/absolute/path/to/file" />` - Reference an entire file
- `<ref_snippet file="/absolute/path/to/file" lines="start-end" />` - Reference specific lines in a file

<example>
user: Where are errors from the client handled?
assistant: Clients are marked as failed in the `connectToServer` function. <ref_snippet file="/home/ubuntu/repos/project/src/services/process.ts" lines="710-715" />
</example>

<example>
user: Can you show me the config file?
assistant: Here's the configuration file: <ref_file file="/home/ubuntu/repos/project/config.json" />
</example>

## Tool usage policy

- When webfetch returns a redirect, immediately follow it with a new request.
- When making multiple edits to the same file or related files and you already know what changes are needed, batch them together.

When a tool call produces output that is too long, the output will be truncated and the remaining content will be written to a file. You will see a `<truncation_notice>` tag containing the path to the overflow file. You are responsible for reading this file if you need the full output.


# Programming

Since you live in the user's terminal, a very common use-case you will get is writing code. Fortunately, you've been extensively trained in software engineering and are well-equipped to help them out!

## Existing Conventions

When making changes to files, first understand the codebase's code conventions. Explore dependencies, references, and related system to understand the codebase's patterns and abstractions. Mimic code style, use existing libraries and utilities, and follow existing patterns.
- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language). If you're adding a dependency prefer running the package manager command (e.g. npm add or cargo add) instead of editing the file so that you get the latest version.
- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.
- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.
- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository. Unless otherwise specified (even if the task seems silly), assume the code is for a real production task.

## Code style

- IMPORTANT: Do NOT add or remove comments unless asked! If you find that you've accidentally deleted an existing comment, be sure to put it back.
- Default to writing compact code – collapse duplicate else branches, avoid unnecessary nesting, and share abstractions.
- Follow idiomatic conventions for the language you're writing.
- Avoid excessive & verbose error handling in your code. Errors should be handled, but not every line needs to be try/catched. Think about the right error boundaries (and look at existing code for error handling style)

## Debugging

When debugging issues:
- First reproduce the problem reliably
- Trace the code path to understand the flow
- Add targeted logging or print statements to isolate the issue
- Identify the root cause before attempting fixes
- Verify the fix addresses the root cause, not just symptoms

## Workflow

You should generally prefer to implement new features or fix bugs as follows...

1. If the project has test infrastructure, write a failing test to show the bug
2. Fix the bug
3. Ensure that the test now passes

Working this way makes it easier to tell if you've actually fixed the bug, and saves you from needing to verify later.

## Git

### Creating commits
1. Run in parallel: `git status`, `git diff`, `git log` (to match commit style)
2. Draft a concise commit message focusing on "why" not "what". Check for sensitive info.
3. Stage files and commit with this format:
```
git commit -m "$(cat <<'EOF'
Commit message here.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
EOF
)"
```
4. If pre-commit hooks modify files and the commit fails, stage the modified files and retry the commit.

### Creating pull requests
Use `gh` for all GitHub operations. Run in parallel: `git status`, `git diff`, `git log`, `git diff main...HEAD`

Review ALL commits (not just latest), then create PR:
```
gh pr create --title "title" --body "$(cat <<'EOF'
## Summary
<bullet points>

#### Test plan
<checklist>

Generated with [Devin](https://devin.ai)
EOF
)"
```

### Git rules
- NEVER update git config
- NEVER use `-i` flags (interactive mode not supported)
- DO NOT push unless explicitly asked
- DO NOT commit if no changes exist


# Task Management

You have access to the todo_write tool to help you manage and plan tasks. Use this tool VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.
This tool is also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.

It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.

Examples:

<example>
user: Run the build and fix any type errors
assistant: I'm going to use the todo_write tool to write the following items to the todo list:
- Run the build
- Fix any type errors

I'm now going to run the build using exec.

Looks like I found 10 type errors. I'm going to use the todo_write tool to write 10 items to the todo list.

marking the first todo as in_progress

Let me start working on the first item...

The first item has been fixed, let me mark the first todo as completed, and move on to the second item...
..
..
</example>

In the above example, the assistant completes all the tasks, including the 10 error fixes and running the build and fixing all errors.

<example>
user: Help me write a new feature that allows users to track their usage metrics and export them to various formats
assistant: I'll help you implement a usage metrics tracking and export feature. Let me first use the todo_write tool to plan this task.
Adding the following todos to the todo list:
1. Research existing metrics tracking in the codebase
2. Design the metrics collection system
3. Implement core metrics tracking functionality
4. Create export functionality for different formats

Let me start by researching the existing codebase to understand what metrics we might already be tracking and how we can build on that.

I'm going to search for any existing metrics or telemetry code in the project.

I've found some existing telemetry code. Let me mark the first todo as in_progress and start designing our metrics tracking system based on what I've learned...

[Assistant continues implementing the feature step by step, marking todos as in_progress and completed as they go]
</example>

Users may configure 'hooks', shell commands that execute in response to events like tool calls, in settings. Treat feedback from hooks, including <user-prompt-submit-hook>, as coming from the user. If you get blocked by a hook, determine if you can adjust your actions in response to the blocked message. If not, ask the user to check their hooks configuration.


## Completing Tasks

The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:
- Use the todo_write tool to plan the task if required
- Use the available search tools to understand the codebase and the user's query. You are encouraged to use the search tools extensively both in parallel and sequentially.
- Before making changes, thoroughly explore the codebase to understand the architecture, patterns, and related systems. Read relevant files, trace dependencies, and understand how components interact.
- Implement the solution using all tools available to you

## Verification

Before considering a task complete, verify your work. Use judgment based on what you changed - optimize for fast iteration:

- Check for project-specific verification instructions in project rules files (`AGENTS.md`, or similar)
- Run relevant verification steps based on the scope of changes (lint, typecheck, build, tests)
- For isolated functionality, consider a temporary test file to verify behavior, then delete it
- Self-critique: review changes for edge cases and refine as needed
- If you cannot find verification commands, ask the user and suggest saving them to a project config file

## Saving learned information

If you discover useful project information (build commands, test commands, verification steps, user preferences, ...) that isn't already documented:
- If a rules file exists (`AGENTS.md`, etc.), append to it
- Otherwise, create `AGENTS.md` in the current directory with the learned information

## Error recovery

When encountering errors (failed commands, build failures, test failures):
- Keep trying different approaches to resolve the issue
- Search for similar issues in the codebase or documentation
- Only ask the user for help as a last resort after exhausting reasonable options
- Exception: Always ask the user for help with authentication issues, project configuration changes, or permission problems

## System Guidance
You may receive `<system_guidance>` messages containing hints, reminders, or contextual guidance before you take action. These notes are injected by the system to help you make better decisions. Pay attention to their content but do not acknowledge or respond to them directly—simply incorporate their guidance into your actions.



# Tool Tips

## Shell
Use your provided search tools instead of `rg`, `grep`, or `find` whenever possible.


## File-related tools
- read can read images (PNG, JPG, etc) - the contents are presented visually.
- For Jupyter notebooks (.ipynb files), use notebook_read instead of read.
- Speculatively read multiple files as a batch when potentially useful.
- Do NOT create documentation files to describe your changes or plan. Exception: persistent project info files like `AGENTS.md` are allowed.


# Safety

IMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously. Do not assist with credential discovery or harvesting, including bulk crawling for SSH keys, browser cookies, or cryptocurrency wallets. Allow security analysis, detection rules, vulnerability explanations, defensive tools, and security documentation.

IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.

## Destructive Operations

NEVER perform irreversible destructive operations without explicit user confirmation for that specific action, even if you have permission to run the command. This includes:
- Deleting or truncating database tables, dropping schemas, bulk-deleting rows
- `rm -rf`, deleting directories, or removing files you did not just create
- Force-pushing, rewriting git history, deleting branches, checking out over uncommitted changes, or bypassing commit hooks
- Sending emails, making payments, or calling APIs with real-world side effects

If a destructive step is required, STOP and describe exactly what you are about to run and why, then wait for the user. Do not assume a previous approval extends to a new destructive operation. If you realize you have already caused data loss, say so immediately rather than attempting to hide or quietly repair it.



## Available MCP Servers (for third-party tools)

{"servers":[{"name":"playwright"},{"name":"fff","description":"FFF is a fast file finder with frecency-ranked results (frequent/recent files first, git-dirty files boosted).\n\n## Which Tool Should I Use?\n\n- **grep**: DEFAULT tool. Searches file CONTENTS -- definitions, usage, patterns. Use when you have a specific name or pattern.\n- **find_files**: Explores which files/modules exist for a topic. Use when you DON'T have a specific identifier or LOOKING FOR A FILE.\n- **multi_grep**: OR logic across multiple patterns. Use for case variants (e.g. ['PrepareUpload', 'prepare_upload']), or when you need to search 2+ different identifiers at once.\n\n## Core Rules\n\n### 1. Search BARE IDENTIFIERS only\nGrep matches single lines. Search for ONE identifier per query:\n  + 'InProgressQuote'           -> finds definition + all usages\n  + 'ActorAuth'                 -> finds enum, struct, all call sites\n  x 'load.*metadata.*InProgressQuote' -> regex spanning multiple tokens, 0 results\n  x 'ctx.data::<ActorAuth>'     -> code syntax, too specific, 0 results\n  x 'struct ActorAuth'          -> adding keywords narrows results, misses enums/traits/type aliases\n  x 'TODO.*#\\d+'               -> complex regex, use simple 'TODO' then filter visually\n\n### 2. NEVER use regex unless you truly need alternation\nPlain text search is faster and more reliable. Regex patterns like `.*`, `\\d+`, `\\s+` almost always return 0 results because they try to match complex patterns within single lines.\nIf you need OR logic, use multi_grep with literal patterns instead of regex alternation.\n\n### 3. Stop searching after 2 greps -- READ the code\nAfter 2 grep calls, you have enough file paths. Read the top result to understand the code.\nDo NOT keep grepping with variations. More greps != better understanding.\n\n### 4. Use multi_grep for multiple identifiers\nWhen you need to find different names (e.g. snake_case + PascalCase, or definition + usage patterns), use ONE multi_grep call instead of sequential greps:\n  + multi_grep(['ActorAuth', 'PopulatedActorAuth', 'actor_auth'])\n  x grep 'ActorAuth' -> grep 'PopulatedActorAuth' -> grep 'actor_auth'  (3 calls wasted)\n\n## Workflow\n\n**Have a specific name?** -> grep the bare identifier.\n**Need multiple name variants?** -> multi_grep with all variants in one call.\n**Exploring a topic / finding files?** -> find_files.\n**Got results?** -> Read the top file. Don't grep again.\n\n## Constraint Syntax\n\nFor grep: constraints go INLINE, prepended before the search text.\nFor multi_grep: constraints go in the separate 'constraints' parameter.\n\nConstraints MUST match one of these formats:\n  Extension: '*.rs', '*.{ts,tsx}'\n  Directory: 'src/', 'quotes/'\n  Filename: 'schema.rs', 'src/main.rs'\n  Exclude: '!test/', '!*.spec.ts'\n\n! Bare words without extensions are NOT constraints. 'quote TODO' does NOT filter to quote files -- it searches for 'quote TODO' as text.\n  + 'schema.rs TODO'   -> searches for 'TODO' in files schema.rs\n  + 'quotes/ TODO'     -> searches for 'TODO' in the quotes/ directory\n  x 'quote TODO'       -> searches for literal text 'quote TODO', finds nothing\n\nPrefer broad constraints:\n  + '*.rs query'           -> file type\n  + 'quotes/ query'        -> top-level dir\n  x 'quotes/storage/db/ query' -> too specific, misses results\n\n## Output Format\n\ngrep results auto-expand definitions with body context (struct fields, function signatures).\nThis often provides enough information WITHOUT a follow-up Read call.\nLines marked with | are definition body context. [def] marks definition files.\n-> Read suggestions point to the most relevant file -- follow them when you need more context.\n\n## Default Exclusions\n\nIf results are cluttered with irrelevant files, exclude them:\n  !tests/ - exclude tests directory\n  !*.spec.ts - exclude test files\n  !generated/ - exclude generated code"}]}

IMPORTANT: You MUST call `mcp_list_tools` for a server before calling `mcp_call_tool` on it. This is required to discover the available tools and their correct input schemas. Never guess tool names or arguments — always list tools first.
Available subagent profiles for the `run_subagent` tool. Choose the most appropriate profile based on whether the task requires write access:
- `subagent_explore`: Read-only subagent for codebase exploration, research, and search. Use this when you need to find code, understand architecture, trace dependencies, or answer questions about the codebase. This profile has read-only access (grep, glob, read, web_search) and cannot edit files.
- `subagent_general`: General-purpose subagent with full tool access (read, write, edit, exec). Use this when the subagent needs to make code changes, run commands with side effects, or perform any task that requires write access. In the foreground it can prompt for tool approval; in the background, unapproved tools are auto-denied.
You are powered by GLM-5.2.
<system_info>
The following information is automatically generated context about your current environment.
Current workspace directories:
  /Users/root1 (cwd)

Platform: macos
OS Version: Darwin 25.6.0
Today's date: Monday, 2026-06-22

</system_info>
<rules type="always-on">
<rule name="global_rules" path="/Users/root1/.codeium/windsurf/memories/global_rules.md">

</rule>

<rule name="AGENTS" path="/Users/root1/AGENTS.md">
# Agent Preferences

- If I ever paste in a YouTube link, use yt-dlp to summarize the video.
- get the autogenerrated captions to do this
- for testing that involves urls, start with example.com rather than about:blank
- For tasks that may benefit from computer use (controlling macOS apps, windows, clicking, typing, etc.), use the background-computer-use skill to control local macOS apps through the BackgroundComputerUse API

## File search via fff MCP

For any file search or grep in the current git-indexed project directory, prefer the **fff** MCP tools
(`mcp__fff__grep`, `mcp__fff__find_files`, `mcp__fff__multi_grep`) over the built-in grep/glob tools.
fff is frecency-ranked, git-aware, and more token-efficient.

Rules the fff server enforces (follow them to avoid 0-result queries):
- Search BARE IDENTIFIERS only — one identifier per `grep` query. No `load.*metadata.*Foo` style regex.
- Don't use regex unless you truly need alternation; `.*`, `\d+`, `\s+` almost always return 0 results.
- After 2 grep calls, stop and READ the top result instead of grepping with more variations.
- Use `multi_grep` for OR logic across multiple identifiers (e.g. snake_case + PascalCase variants) in one call.
- Have a specific name → `grep`. Exploring a topic / finding files → `find_files`.

The `fff-mcp` binary lives at `/Users/root1/.local/bin/fff-mcp` and is registered at user scope
in `~/.config/devin/config.json`. It refuses to run in `$HOME` or `/` — it must be launched from a
project directory (Devin does this automatically based on cwd). Update with:
`curl -fsSL https://raw.githubusercontent.com/dmtrKovalenko/fff.nvim/main/install-mcp.sh | bash`

## X/Twitter scraping via logged-in browser session

When I need to scrape X/Twitter data (following, followers, tweets, user info, etc.),
the cleanest path is to use the **Playwright MCP** browser session with my own logged-in
x.com account, rather than spinning up twscrape's account-pool flow. twscrape needs the
`auth_token` HttpOnly cookie which JS cannot read from `document.cookie`; the browser
session attaches all cookies automatically.

### Flow
1. `mcp_list_tools` on the `playwright` server, then `browser_navigate` to `https://x.com`.
2. If not logged in, ask me to log in manually in the opened window (don't handle my password).
3. Once on `https://x.com/home`, read `ct0` from `document.cookie`:
   `document.cookie.match(/ct0=([^;]+)/)[1]`
4. Call X's GraphQL endpoints directly via `fetch()` inside `browser_evaluate`. Required headers:
   - `authorization: Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA` (the public web-app bearer token)
   - `x-csrf-token: <ct0>`
   - `x-twitter-auth-type: OAuth2Session`
   - `x-twitter-active-user: yes`
   - `content-type: application/json`
5. Paginate timelines by reading `content.cursorType === "Bottom"` entries and passing
   the value back as `variables.cursor` until it stops changing.

### Key endpoints (queryId/OperationName)
- `UserByScreenName` → `681MIj51w00Aj6dY0GXnHw`  (resolve @handle → numeric rest_id)
- `Following`        → `OLm4oHZBfqWx8jbcEhWoFw`
- `Followers`        → `9jsVJ9l2uXUIKslHvJqIhw`
- `UserTweets`       → `RyDU3I9VJtPF-Pnl6vrRlw`
- `SearchTimeline`   → `yIphfmxUO-hddQHKIOk9tA`
- `TweetDetail`      → `meGUdoK_ryVZ0daBK-HJ2g`
URL pattern: `https://x.com/i/api/graphql/<queryId>/<OpName>?variables=<enc>&features=<enc>`

### Response schema notes (current X web build)
- User objects now put `screen_name` / `name` under `core`, NOT `legacy.screen_name`.
  twscrape's parser still reads `legacy.screen_name` and returns empty — needs updating.
- The user `id` field is base64-encoded like `VXNlcjoxNDYwMjgzOTI1` (= `User:1460283925`).
  Decode with `atob(u.id).split(':')[1]` to get the numeric rest_id. `u.rest_id` may also
  be present directly.
- `is_blue_verified` is the verified flag. `legacy.followers_count`, `legacy.description`
  still exist under `legacy`.
- Filter timeline entries by `content.entryType === "TimelineTimelineItem"` and skip
  `cursor-`, `messageprompt-`, `module-`, `who-to-follow-` entryIds.

### Features dict
Use the full `GQL_FEATURES` block from twscrape's `api.py` — without it X returns
`(336) The following features cannot be null`. Pass it URL-encoded as the `features` param.

### Where things live
- Output CSV:  `~/Downloads/utilities/sdand_following.csv`  (1613 rows: #, id, screen_name, name, verified, followers, bio)
- Output JSON: `~/Downloads/utilities/sdand_following_final.json` (double-encoded JSON string; parse with `json.loads(json.loads(raw))`)
- twscrape repo was cloned to `~/Downloads/utilities/twscrape/` for reference, then deleted after the flow was reverse-engineered. Re-clone from https://github.com/vladkens/twscrape.git if needed.

</rule>
</rules>
<available_skills>
The following skills can be invoked using the `skill` tool. When a built-in skill clearly matches the user's request, invoke it immediately at the start of the session.

- **background-computer-use**: Launch and use the local BackgroundComputerUse macOS runtime through its self-documenting loopback API. Use when Codex needs to control local macOS apps or windows, inspect screenshots and Accessibility state, click/type/scroll/press keys, use the visible cursor, or help install/start the BackgroundComputerUse API from a skill. (source: /Users/root1/.devin/skills/background-computer-use/SKILL.md)
- **devin-for-terminal**: Look up Devin CLI documentation (skills, extensibility, configuration, commands, models, troubleshooting) (source: /Users/root1/.local/share/devin/cli/_versions/2026.7.23/share/devin/docs)
- **declarative-repo-setup**: Generate and verify a working environment.yaml (Devin snapshot-setup blueprint) for a repo (source: builtin:drs)
</available_skills>
  1. You

    fully set up the cursor cli

  2. Devin
    Thinking

    The user wants to fully set up the Cursor CLI. Let me check what's available and what they need.

    web_search(query: Cursor CLI setup install cursor command …)
    {
      "query": "Cursor CLI setup install cursor command line"
    }
    exec(command: which cursor; cursor --version 2>&1; ls …)
    {
      "command": "which cursor; cursor --version 2>&1; ls /Applications/Cursor.app 2>&1 | head -5"
    }
    In 16,407Out 73Cache 50TTFT 2,127mstool_calls
  3. Output# Web Search Results for "Cursor CLI setup install cursor command line"
    # Web Search Results for "Cursor CLI setup install cursor command line"
    
    ## 1. CLI Installation | Cursor Docs
    URL: https://cursor.com/docs/cli/installation
    
    # Installation
    
    ## Installation
    
    ### macOS, Linux and Windows (WSL)
    
    Install Cursor CLI with a single command:
    
    ```bash
    curl https://cursor.com/install -fsS | bash
    
    ```
    
    ### Windows (native)
    
    Install Cursor CLI on Windows using PowerShell:
    
    ```powershell
    irm 'https://cursor.com/install?win32=true' | iex
    
    ```
    
    ### Verification
    
    After installation, verify that Cursor CLI is working correctly:
    
    ```bash
    agent --version
    
    ```
    
    ## Post-installation setup
    
    1. Add ~/.local/bin to your PATH: For bash: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
    source ~/.bashrc
    For zsh: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
    source ~/.zshrc
    
    2. Start using Cursor Agent: agent
    
    ## Updates
    
    Cursor CLI will try to auto-update by default to ensure you always have the latest version.
    
    To manually update Cursor CLI to the latest version:
    
    ```bash
    agent update
    
    ```
    
    ---
    
    ## Sitemap
    
    Overview of all docs pages
    
    ## 2. CLI | Cursor Docs
    URL: https://cursor.com/help/integrations/cli
    
    # CLI
    
    Ship code with AI agents right from your terminal.
    
    ## How do I install the CLI?
    
    ```bash
    curl https://cursor.com/install -fsS | bash
    
    ```
    
    On Windows PowerShell:
    
    ```powershell
    irm 'https://cursor.com/install?win32=true' | iex
    
    ```
    
    ## What can the CLI do?
    
    The CLI brings Cursor's AI capabilities to your terminal. It supports Agent, Plan, and Ask modes, so you can do almost everything you'd do in the editor without opening an IDE.
    
    Learn more at cursor.com/cli.
    
    ## Can I use the CLI for automation?
    
    Yes. Use headless mode for scripts, CI pipelines, and GitHub Actions. Automate doc updates, trigger security reviews, or build custom coding workflows. See the Headless CLI docs for setup.
    
    ## Does the CLI work with other editors?
    
    Yes. Cursor CLI works with any IDE or editor, not just Cursor. Plug it into your existing workflow anywhere you have a terminal.
    
    ## How do I authenticate the CLI?
    
    Run `agent auth` or set the `CURSOR_API_KEY` environment variable. See the CLI authentication docs for details.
    
    ## What if the CLI reports "invalid API key" on a network error?
    
    If DNS resolution fails or the CLI can't reach Cursor's servers, the error message may say "invalid API key" instead of a network error. Check your network connection first. If you're behind a VPN or firewall, verify that `*.cursor.sh` and `*.cursorapi.com` are accessible.
    
    ## How do I update the CLI?
    
    Run:
    
    ```bash
    agent update
    
    ```
    
    To switch release channels (e.g., from `stable` to `lab`), run:
    
    ```bash
    agent set-channel lab
    
    ```
    
    ## Related
    
    - CLI overview
    - CLI installation
    - CLI authentication
    - GitHub Actions
    - cursor.com/cli
    
    ---
    
    ## Sitemap
    
    Overview of all docs pages
    
    ## 3. Getting Started with Cursor CLI: A Complete Guide | Codecademy
    URL: https://www.codecademy.com/article/getting-started-with-cursor-cli
    
    In this article, we will look at what Cursor CLI is, how to install it, how to build with it, and its key features.
    ...
    Cursor CLI is a terminal-based AI assistant designed to help developers write, review, debug, and test code directly from the command line. Instead of moving back and forth between an IDE, documentation, and terminal windows, you can stay in one environment and interact with Cursor using natural language prompts.
    ...
    Cursor CLI requires a Cursor subscription to use. You can check current pricing and subscription options on the Cursor website before installing.
    ...
    Let’s begin by setting up Cursor CLI and walking through the installation steps for your system.
    ...
    ## How to install Cursor CLI?
    ...
    Installing Cursor CLI is straightforward across macOS, Linux, and Windows (using WSL). Here are the steps to get started:
    ...
    ### Step 1: Install Cursor CLI
    ...
    Open your terminal and run:
    ...
    ```
    curl https://cursor.com/install -fsS | bash
    ```
    ...
    This command downloads and installs Cursor CLI on your system.
    ...
    ### Step 2: Verify the installation
    ...
    After installation, make sure Cursor CLI is working correctly by running:
    ...
    ```
    cursor-agent --version
    ```
    ...
    You should see the installed version of Cursor CLI displayed in your terminal.
    ...
    ### Step 3: Add Cursor CLI to the PATH
    ...
    To run Cursor CLI from anywhere, add its installation directory to your PATH:
    ...
    For bash:
    ...
    ```
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc source ~/.bashrc 
    ```
    ...
    For zsh:
    ...
    ```
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc source ~/.zshrc 
    ```
    ...
    With these steps complete, Cursor CLI is installed and ready. Let’s start using Cursor CLI to build a travel app.
    ...
    ### Step 1: Set up
    ...
    Start Cursor CLI by running the following command in your terminal:
    ...
    ```
    cursor-agent 
    ```
    ...
    ` command.
    ...
    ### 2. How to use Cursor CLI in Windows?
    ...
    On Windows, you can install Cursor CLI using the official install script via WSL (Windows Subsystem f...
    
    ## 4. Installing Cursor CLI | BenXHub Blog
    URL: https://benxhub.com/en/blog/cursor/cli/01-install
    
    Installing Cursor CLI | BenXHub Blog
    
    Installation is straightforward: run the official script in your terminal and you'll have the`cursor` command available. Instructions vary by platform.
    
    ## macOS / Linux / WSL
    
    Run this in your terminal:
    
    ```
    curl https://cursor.com/install -fsS | bash
    ```
    
    - The script automatically downloads and installs the`cursor` command
    - After installation, close and reopen your terminal, or run`source ~/.bashrc`/`source ~/.zshrc` to update your PATH
    
    ## Windows (PowerShell)
    
    Open PowerShell as Administrator and run:
    
    ```
    irm 'https://cursor.com/install?win32=true' | iex
    ```
    
    ## Verify the Installation
    
    ```
    cursor --version
    ```
    
    If a version number appears, the installation was successful.
    
    ## First Use: Log In
    
    The first time you run it, you may be prompted to log in to your Cursor account:
    
    ```
    cursor auth login
    ```
    
    Follow the on-screen instructions to complete login via your browser. On the same machine, you typically won't need to log in again.
    
    ## Summary
    
    - macOS / Linux:`curl ... | bash`
    - Windows: Run`irm ... | iex` in PowerShell
    - Verify:`cursor --version`
    - Login:`cursor auth login`
    
    Next: 02-basic-usage— Learn how to run commands and chat with the AI
    
    ## 5. Using Agent in CLI | Cursor Docs
    URL: https://cursor.com/docs/cli/using
    
    # Using Agent in CLI
    ...
    The CLI supports the same modes as the editor. Switch modes using slash commands or the `--mode` flag.
    ...
    ask` to switch to Ask mode
    ...
    - Shift+Tab — Rotate between modes (Agent, Plan, Ask)
    - Shift+Enter — Insert a newline instead of submitting, making it easier to write multi-line prompts.
    - Ctrl+D — Exit the CLI. Follows standard shell behavior, requiring a double-press to exit.
    - Ctrl+J or +Enter — Universal alternatives for inserting newlines that work in all terminals.
    ...
    Shift+Enter works in iTerm2, Ghostty, Kitty, Warp, and Zed. For tmux users, use Ctrl+J instead. See Terminal setup for configuration options and troubleshooting.
    ...
    Pass `-w` or `--worktree [name]` to run the agent in a new Git worktree instead of editing your current checkout directly. Cursor creates these checkouts under `~/.cursor/worktrees/ / `, alongside worktrees created from the editor. If you omit `name`, Cursor generates one.
    ...
    Combine `--workspace ` when you need an explicit repository root. Otherwise the CLI uses the current working directory. `--worktree` only changes where the agent makes file edits inside that project.
    ...
    Continue from an existing thread with `--resume [thread id]` to load prior context.
    ...
    To resume the most recent conversation, use `agent resume`, `--continue`, or the `/resume` slash command.
    ...
    Use `-p` or `--print` to run Agent in non-interactive mode. This will print the response to the console.
    
  4. OutputOutput from command in shell b1a992:
    Output from command in shell b1a992:
    bash: cursor: command not found
    Contents
    
    
    Exit code: 0
  5. Devin
    Thinking

    Cursor.app is installed but the CLI isn't. Let me install it.

    Cursor.app is installed but the CLI isn't. Let me install it via the official installer.

    exec(command: curl https://cursor.com/install -fsS | b…)
    {
      "command": "curl https://cursor.com/install -fsS | bash"
    }
    In 1,947Out 55Cache 16,456TTFT 1,130mstool_calls
  6. OutputOutput from command in shell 31f97b:
    Output from command in shell 31f97b:
    
    Cursor Agent Installer
    
    ▸ Detecting system architecture...
    ✓ Detected darwin/arm64
    ▸ Creating installation directory...
    ✓ Directory created
    ▸ Downloading Cursor Agent package...
      Download URL: https://downloads.cursor.com/lab/2026.06.19-20-24-33-653a7fb/darwin/arm64/agent-cli-package.tar.gz
    
                                                                               0.1%
    ##                                                                         4.0%
    ######                                                                     9.1%
    ##########                                                                14.4%
    ##############                                                            19.9%
    ##################                                                        25.2%
    ###################                                                       27.1%
    ########################                                                  34.4%
    ############################                                              39.2%
    ################################                                          44.5%
    ###################################                                       49.8%
    #######################################                                   55.2%
    ###########################################                               60.7%
    ###############################################                           66.0%
    ###################################################                       71.5%
    #######################################################                   76.8%
    ###########################################################               82.4%
    ###############################################################           87.7%
    ###################################################################       93.1%
    ######################################################################    98.5%
    ######################################################################## 100.0%
    ✓ Package downloaded and extracted
    ▸ Finalizing installation...
    ✓ Package installed successfully
    ▸ Creating bin directory...
    ✓ Bin directory ready
    ▸ Creating symlinks to agent executable...
    ✓ Symlink created
    
    ✨ Installation Complete! 
    
    
    Start using Cursor Agent:
       agent
    
    
    Happy coding! 🚀
    
    
    
    Exit code: 0
  7. Devin
    exec(command: ls -la ~/.local/bin/ | grep -i -E 'agent…)
    {
      "command": "ls -la ~/.local/bin/ | grep -i -E 'agent|cursor'; echo \"---\"; ~/.local/bin/agent --version 2>&1; echo \"---\"; echo $PATH | tr ':' '\\n' | grep -n local"
    }
    In 452Out 60Cache 18,402tool_calls
  8. OutputOutput from command in shell 4f714e:
    Output from command in shell 4f714e:
    lrwxr-xr-x  1 root1  staff         88 Jun 22 18:15 agent -> /Users/root1/.local/share/cursor-agent/versions/2026.06.19-20-24-33-653a7fb/cursor-agent
    lrwxr-xr-x  1 root1  staff         88 Jun 22 18:15 cursor-agent -> /Users/root1/.local/share/cursor-agent/versions/2026.06.19-20-24-33-653a7fb/cursor-agent
    ---
    2026.06.19-20-24-33-653a7fb
    ---
    5:/Users/root1/.local/bin
    6:/usr/local/bin
    12:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin
    
    
    Exit code: 0
  9. Devin
    Thinking

    `~/.local/bin` is already in PATH. Let me check the shell config and verify the agent command works in a fresh shell. Also check auth status.

    ~/.local/bin is already in PATH. Let me verify the binary runs and check auth status.

    exec(command: agent --version 2>&1; echo "---auth---";…)
    {
      "command": "agent --version 2>&1; echo \"---auth---\"; agent auth 2>&1 | head -30"
    }
    In 259Out 88Cache 18,853TTFT 1,260mstool_calls
  10. OutputOutput from command in shell cc801c:
    Output from command in shell cc801c:
    2026.06.19-20-24-33-653a7fb
    ---auth---
    Error: Authentication required. Please run 'agent login' first, or set CURSOR_API_KEY environment variable.
    
    
    Exit code: 0
  11. Devin
    Thinking

    The CLI is installed. Now I need to authenticate. The user needs to log in. Since `agent login` likely opens a browser for OAuth, and that's an interactive flow involving the user's account credentials, I should ask the user how they want to authenticate rather than handling it myself. Let me check the login options.

    The CLI is installed and working. Authentication is required next — this involves your Cursor account credentials, so I need your input on how to proceed.

    exec(command: agent login --help 2>&1; echo "---"; age…)
    {
      "command": "agent login --help 2>&1; echo \"---\"; agent --help 2>&1 | head -40"
    }
    In 152Out 128Cache 19,111TTFT 1,107mstool_calls
  12. OutputOutput from command in shell 0df3ad:
    Output from command in shell 0df3ad:
    Usage: agent login [options]
    
    Authenticate with Cursor. Set NO_OPEN_BROWSER to disable browser opening.
    
    Options:
      -h, --help  Display help for command
    ---
    Usage: agent [options] [command] [prompt...]
    
    Start the Cursor Agent
    
    Arguments:
      prompt                       Initial prompt for the agent
    
    Options:
      -v, --version                Output the version number
      --api-key <key>              API key for authentication (can also use
                                   CURSOR_API_KEY env var)
      -H, --header <header>        Add custom header to agent requests (format:
                                   'Name: Value', can be used multiple times)
      -p, --print                  Print responses to console (for scripts or
                                   non-interactive use). Has access to all tools,
                                   including write and shell. (default: false)
      --output-format <format>     Output format (only works with --print): text |
                                   json | stream-json (default: "text")
      --stream-partial-output      Stream partial output as individual text deltas
                                   (only works with --print and stream-json format)
                                   (default: false)
      --mode <mode>                Start in the given execution mode. plan:
                                   read-only/planning (analyze, propose plans, no
                                   edits). ask: Q&A style for explanations and
                                   questions (read-only). (choices: "plan", "ask")
      --plan                       Start in plan mode (shorthand for --mode=plan).
                                   (default: false)
      --resume [chatId]            Select a session to resume (default: false)
      --continue                   Continue previous session (default: false)
      --model <model>              Model to use (e.g., gpt-5, sonnet-4-thinking).
                                   Parameterized models accept quoted bracket
                                   overrides, e.g.
                                   'claude-opus-4-8[context=1m,effort=high,fast=false]'
      --list-models                List available models and exit (default: false)
      -f, --force                  Force allow commands unless explicitly denied
                                   (default: false)
      --yolo                       Alias for --force (Run Everything) (default:
                                   false)
      --sandbox <mode>             Explicitly enable or disable sandbox mode
                                   (overrides config) (choices: "enabled",
    
    
    Exit code: 0
  13. Devin
    ask_user_question(questions: [{"question":"How do you want to authent…)
    {
      "questions": [
        {
          "question": "How do you want to authenticate the Cursor CLI?",
          "header": "Auth method",
          "options": [
            {
              "label": "Browser OAuth login",
              "description": "Run `agent login` — opens a browser window for you to sign in to your Cursor account. Best for interactive use."
            },
            {
              "label": "API key env var",
              "description": "Set CURSOR_API_KEY in your shell config. Best for headless/CI use. You'd paste the key from cursor.com/settings."
            },
            {
              "label": "Skip for now",
              "description": "Leave auth for later — CLI is installed and ready, you'll run `agent login` yourself when you first use it."
            }
          ]
        }
      ]
    }
    In 638Out 157Cache 19,262tool_calls
  14. OutputUser answered your questions:
    User answered your questions:
    {
      "How do you want to authenticate the Cursor CLI?": {
        "selected": [
          "Browser OAuth login"
        ]
      }
    }
  15. Devin

    Running agent login — this will open a browser window for you to sign in to your Cursor account.

    exec(command: agent login, interactive_shell: bash, run_in_background: true)
    {
      "command": "agent login",
      "interactive_shell": "bash",
      "run_in_background": true
    }
    In 198Out 49Cache 19,899TTFT 917mstool_calls
  16. OutputTool 'exec' validation failed: Failed to parse input: JSON error: unknown variant `bash`, expected `
    Tool 'exec' validation failed: Failed to parse input: JSON error: unknown variant `bash`, expected `Bash` or `PowerShell`
  17. Devin
    exec(command: agent login, interactive_shell: Bash, run_in_background: true)
    {
      "command": "agent login",
      "interactive_shell": "Bash",
      "run_in_background": true
    }
    In 84Out 28Cache 20,096tool_calls
  18. OutputCommand running in background with ID: 9a35ba
    Command running in background with ID: 9a35ba
  19. Devin
    get_output(shell_id: 9a35ba, timeout: 8000)
    {
      "shell_id": "9a35ba",
      "timeout": 8000
    }
    In 45Out 23Cache 20,179tool_calls
  20. OutputStarting login process...
    Starting login process...
    Authenticating with Cursor...
    Waiting for browser authentication...
    If your browser didn't open, use this link:
    https://cursor.com/loginDeepControl?challenge=uWRG9E2wzLXeLq1rIJ0NDPpMl8Frhwifuo
    p1fBoXGx0&uuid=fc59160c-d594-452b-8978-b1869b997821&mode=login&redirectTarget=cl
    i
    ✓ Logged in as huan2350@purdue.edu
    Authentication tokens stored securely.
    
    Exit code: 0
  21. Devin

    Login succeeded. Let me verify everything works end-to-end.

    exec(command: agent auth 2>&1 | head -10; echo "---mod…)
    {
      "command": "agent auth 2>&1 | head -10; echo \"---models---\"; agent --list-models 2>&1 | head -20"
    }
    In 163Out 51Cache 20,223TTFT 880mstool_calls
  22. OutputOutput from command in shell 4511e6:
    Output from command in shell 4511e6:
    
    ⚠ Workspace Trust Required
    
      Cursor Agent can execute code and access files in this directory.
      Do you trust the contents of this directory?
    
        /Users/root1
    
      To proceed, you can either:
        • Run 'agent' interactively to decide
    ---models---
    Available models
    
    auto - Auto
    gpt-5.3-codex-low - Codex 5.3 Low
    gpt-5.3-codex-low-fast - Codex 5.3 Low Fast
    gpt-5.3-codex - Codex 5.3
    gpt-5.3-codex-fast - Codex 5.3 Fast
    gpt-5.3-codex-high - Codex 5.3 High
    gpt-5.3-codex-high-fast - Codex 5.3 High Fast
    gpt-5.3-codex-xhigh - Codex 5.3 Extra High
    gpt-5.3-codex-xhigh-fast - Codex 5.3 Extra High Fast
    gpt-5.2 - GPT-5.2
    gpt-5.2-codex-low - Codex 5.2 Low
    gpt-5.2-codex-low-fast - Codex 5.2 Low Fast
    gpt-5.2-codex - Codex 5.2
    gpt-5.2-codex-fast - Codex 5.2 Fast
    gpt-5.2-codex-high - Codex 5.2 High
    gpt-5.2-codex-high-fast - Codex 5.2 High Fast
    gpt-5.2-codex-xhigh - Codex 5.2 Extra High
    gpt-5.2-codex-xhigh-fast - Codex 5.2 Extra High Fast
    
    
    Exit code: 0
  23. Devin
    Thinking

    Everything works. The auth check triggered a workspace trust prompt because cwd is $HOME. That's expected — the user will get the trust prompt when running in their home dir. Let me mark complete and summarize.

    Cursor CLI is fully set up. Summary:

    Installed:

    • agent / cursor-agent~/.local/share/cursor-agent/versions/2026.06.19-20-24-33-65a7fb/cursor-agent
    • Symlinks in ~/.local/bin/ (already on your PATH)
    • Version: 2026.06.19-20-24-33-65a7fb (lab channel)

    Authenticated: Logged in as huan2350@purdue.edu (tokens stored securely via agent login).

    Verified: agent --list-models returns the full model list (gpt-5.3-codex, gpt-5.2, etc.), so auth + API connectivity are working.

    Usage:

    • agent — start interactive session
    • agent -p "..." — non-interactive/print mode
    • agent --plan or --mode plan|ask — switch modes
    • agent --model <name> — pick a model
    • agent update — manual update (auto-updates by default)
    • agent set-channel lab|stable — switch release channel

    One note: running agent from $HOME (/Users/root1) triggers a workspace-trust prompt because it's your home directory. Run it from a project directory instead, or accept the trust prompt when it appears.

    In 470Out 349Cache 20,385TTFT 923ms