Agent Skills › codeany-ai/codeany › headless-codeany

headless-codeany

GitHub

指导在Linux、macOS或Windows上安装CodeAny独立服务器,启动后台服务并登录账号。涵盖环境检测、二进制安装、服务配置及OAuth认证流程。

packaging/skills/headless-codeany/SKILL.md codeany-ai/codeany

Trigger Scenarios

用户需要在远程或本地机器部署CodeAny服务 需要连接CodeAny Desktop到当前主机

Install

npx skills add codeany-ai/codeany --skill headless-codeany -g -y
More Options

Non-standard path

npx skills add https://github.com/codeany-ai/codeany/tree/main/packaging/skills/headless-codeany -g -y

Use without installing

npx skills use codeany-ai/codeany@headless-codeany

指定 Agent (Claude Code)

npx skills add codeany-ai/codeany --skill headless-codeany -a claude-code -g -y

安装 repo 全部 skill

npx skills add codeany-ai/codeany --all -g -y

预览 repo 内 skill

npx skills add codeany-ai/codeany --list

SKILL.md

Frontmatter
{
    "name": "headless-codeany",
    "description": "Install the CodeAny standalone server, start its background service, and sign in with a codeany.ai account so CodeAny Desktop can connect to this machine."
}

Install and Connect CodeAny Server

Use this skill to install the standalone CodeAny server (codeany) on Linux, macOS, or Windows, start its background service, and link the machine to the user's codeany.ai account.

Supported Platforms

  • Linux (x86_64, aarch64)
  • macOS (aarch64 / Apple Silicon, x86_64)
  • Windows (x86_64, PowerShell)

Step 1: Detect the OS and Existing Installation

Check the operating system and whether codeany is already installed:

  • Linux / macOS:
    uname -sm
    command -v codeany || ls -l "$HOME/.local/bin/codeany" 2>/dev/null
    
  • Windows (PowerShell):
    $bin = Join-Path $env:LOCALAPPDATA 'CodeAny\bin\codeany.exe'
    Test-Path $bin
    

If codeany is already installed, check its version (codeany --version) and whether the background service is running (codeany service probe).

Step 2: Install (or Update) the CodeAny Server Binary

The official installers download the latest checksum-verified release and restart any already-running service.

  • Linux / macOS:

    curl -fsSL 'https://cdn.codeany.ai/scripts/headless-codeany/install.sh' | sh
    
    • Installs to ~/.local/bin/codeany by default (CODEANY_INSTALL_DIR overrides the directory).
    • If ~/.local/bin is not in PATH, use "$HOME/.local/bin/codeany" directly in the following commands, and let the user know how to add it to PATH.
  • Windows (PowerShell):

    & ([scriptblock]::Create((Invoke-RestMethod -ErrorAction Stop -Uri 'https://cdn.codeany.ai/scripts/headless-codeany/install.ps1')))
    
    • Installs to %LOCALAPPDATA%\CodeAny\bin\codeany.exe by default (CODEANY_INSTALL_DIR overrides it).

Step 3: Start the Background Service

Ensure codeany serve is running and stays running across logins/reboots.

  • Linux / macOS:

    1. Run:
      "${HOME}/.local/bin/codeany" service install
      
      (Or codeany service install if codeany is already in PATH.)
    2. If user systemd is unavailable (for example inside a container or minimal Linux host where systemctl --user cannot connect), start the service directly in the background:
      data="${CODEANY_HOME:-$HOME/.codeany}"
      (umask 077; mkdir -p "$data"; nohup "${HOME}/.local/bin/codeany" serve </dev/null >>"$data/serve.log" 2>&1 &)
      
    3. Verify the service is ready (retry for a few seconds if just started):
      "${HOME}/.local/bin/codeany" service probe
      
  • Windows (PowerShell):

    $bin = Join-Path $env:LOCALAPPDATA 'CodeAny\bin\codeany.exe'
    & $bin service install
    & $bin service probe
    

Step 4: Sign In with codeany.ai

codeany login performs an interactive OAuth sign-in. It prints an authorization URL, tries to open a local browser, and waits for either a loopback callback (on a machine with a browser) or the user pasting the redirected URL / authorization code into stdin (on a headless remote server).

Important for AI Agents:

  1. Do not run codeany login as a blocking command without surfacing its output to the user — it will wait for OAuth completion until it times out.
  2. Start codeany login in a background process (or interactive terminal/PTY) whose stdout you can read and whose stdin you can write to:
    • Linux / macOS: "${HOME}/.local/bin/codeany" login
    • Windows: & (Join-Path $env:LOCALAPPDATA 'CodeAny\bin\codeany.exe') login
  3. Check its initial output:
    • If it prints Already signed in to codeany.ai (...) and exits with code 0, this machine is already connected! Ask the user if they want to switch accounts (codeany login --force), otherwise skip to Step 5.
    • Otherwise, it will print a link starting with https://codeany.ai/connect/codeany?....
  4. Send that exact URL to the user and ask them to:
    • Open the URL in their browser and sign in with the same codeany.ai account used in their CodeAny Desktop app.
    • If they approved it in a browser on this same machine, sign-in completes automatically.
    • If this is a remote headless server without a local browser, the browser will redirect to http://127.0.0.1:... (which will fail to load on their local machine — that is expected). Ask the user to copy and paste that redirected URL (or the authorization code) back to you.
  5. When the user sends the redirected URL or code, write it (followed by a newline) to the running codeany login process's stdin.
  6. Confirm codeany login prints Signed in to codeany.ai ... and exits with code 0.

Step 5: Verify and Report

  1. Confirm the background service is healthy:
    codeany service probe
    
  2. Remind the user:
    • This machine will now appear under Settings → Devices → Script connection (and Shared devices) in CodeAny Desktop.
    • Any coding agents they want to run remotely (such as Claude Code, Codex, etc.) should be installed and signed in as this same OS user on this machine.
    • Future server updates can be triggered from CodeAny Desktop or by running codeany update.

Version History

  • a84d276 Current 2026-12-04 14:51

Metadata

Files
0
Version
8783614
Hash
8337a4d8
Indexed
2026-12-04 14:51

홈 - 위키
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-12-05 06:12
浙ICP备14020137号-1