* align docs and contract

* clean

* rename from deskctl-cli to deskctl

* runtime
This commit is contained in:
Hari 2026-03-26 08:44:10 -04:00 committed by Harivansh Rathi
parent 88f9ff85a3
commit eac3a61ceb
18 changed files with 41 additions and 47 deletions

View file

@ -189,7 +189,7 @@ jobs:
NEW="${{ needs.changes.outputs.version }}" NEW="${{ needs.changes.outputs.version }}"
if [ "$CURRENT" != "$NEW" ]; then if [ "$CURRENT" != "$NEW" ]; then
sed -i "0,/^version = \"${CURRENT}\"/s//version = \"${NEW}\"/" Cargo.toml sed -i "0,/^version = \"${CURRENT}\"/s//version = \"${NEW}\"/" Cargo.toml
node -e 'const fs=require("node:fs"); const path="npm/deskctl-cli/package.json"; const pkg=JSON.parse(fs.readFileSync(path,"utf8")); pkg.version=process.argv[1]; fs.writeFileSync(path, JSON.stringify(pkg, null, 2)+"\n");' "$NEW" node -e 'const fs=require("node:fs"); const path="npm/deskctl/package.json"; const pkg=JSON.parse(fs.readFileSync(path,"utf8")); pkg.version=process.argv[1]; fs.writeFileSync(path, JSON.stringify(pkg, null, 2)+"\n");' "$NEW"
cargo generate-lockfile cargo generate-lockfile
fi fi
@ -199,7 +199,7 @@ jobs:
git config user.email "github-actions[bot]@users.noreply.github.com" git config user.email "github-actions[bot]@users.noreply.github.com"
if ! git diff --quiet; then if ! git diff --quiet; then
git add Cargo.toml Cargo.lock npm/deskctl-cli/package.json git add Cargo.toml Cargo.lock npm/deskctl/package.json
git commit -m "release: ${{ needs.changes.outputs.tag }} [skip ci]" git commit -m "release: ${{ needs.changes.outputs.tag }} [skip ci]"
fi fi

View file

@ -8,7 +8,7 @@ on:
required: true required: true
type: string type: string
publish_npm: publish_npm:
description: Publish deskctl-cli to npm description: Publish deskctl to npm
required: true required: true
type: boolean type: boolean
default: false default: false
@ -51,7 +51,7 @@ jobs:
TAG="${{ inputs.tag }}" TAG="${{ inputs.tag }}"
VERSION="${TAG#v}" VERSION="${TAG#v}"
CARGO_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/') CARGO_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
NPM_VERSION=$(node -p 'require("./npm/deskctl-cli/package.json").version') NPM_VERSION=$(node -p 'require("./npm/deskctl/package.json").version')
test "$VERSION" = "$CARGO_VERSION" test "$VERSION" = "$CARGO_VERSION"
test "$VERSION" = "$NPM_VERSION" test "$VERSION" = "$NPM_VERSION"
@ -62,7 +62,7 @@ jobs:
VERSION="${{ inputs.tag }}" VERSION="${{ inputs.tag }}"
VERSION="${VERSION#v}" VERSION="${VERSION#v}"
if npm view "deskctl-cli@${VERSION}" version >/dev/null 2>&1; then if npm view "deskctl@${VERSION}" version >/dev/null 2>&1; then
echo "npm=true" >> "$GITHUB_OUTPUT" echo "npm=true" >> "$GITHUB_OUTPUT"
else else
echo "npm=false" >> "$GITHUB_OUTPUT" echo "npm=false" >> "$GITHUB_OUTPUT"
@ -77,8 +77,8 @@ jobs:
- name: Validate npm package - name: Validate npm package
run: | run: |
mkdir -p ./tmp/npm-pack mkdir -p ./tmp/npm-pack
node npm/deskctl-cli/scripts/validate-package.js node npm/deskctl/scripts/validate-package.js
npm pack ./npm/deskctl-cli --pack-destination ./tmp/npm-pack >/dev/null npm pack ./npm/deskctl --pack-destination ./tmp/npm-pack >/dev/null
- name: Validate crate publish path - name: Validate crate publish path
run: cargo publish --dry-run --locked run: cargo publish --dry-run --locked
@ -87,7 +87,7 @@ jobs:
if: inputs.publish_npm && steps.published.outputs.npm != 'true' if: inputs.publish_npm && steps.published.outputs.npm != 'true'
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish ./npm/deskctl-cli --access public run: npm publish ./npm/deskctl --access public
- name: Publish crates.io - name: Publish crates.io
if: inputs.publish_crates && steps.published.outputs.crates != 'true' if: inputs.publish_crates && steps.published.outputs.crates != 'true'

4
.gitignore vendored
View file

@ -5,5 +5,5 @@ secret/
.claude/ .claude/
.codex/ .codex/
openspec/ openspec/
npm/deskctl-cli/vendor/ npm/deskctl/vendor/
npm/deskctl-cli/*.tgz npm/deskctl/*.tgz

View file

@ -70,7 +70,7 @@ The hook config intentionally stays small:
Distribution support currently ships through: Distribution support currently ships through:
- crate: `deskctl` - crate: `deskctl`
- npm package: `deskctl-cli` - npm package: `deskctl`
- repo flake: `flake.nix` - repo flake: `flake.nix`
- command name on every channel: `deskctl` - command name on every channel: `deskctl`

View file

@ -38,10 +38,10 @@ npm-package-check:
echo "npm is required for npm packaging validation."; \ echo "npm is required for npm packaging validation."; \
exit 1; \ exit 1; \
fi fi
node npm/deskctl-cli/scripts/validate-package.js node npm/deskctl/scripts/validate-package.js
rm -rf tmp/npm-pack tmp/npm-install rm -rf tmp/npm-pack tmp/npm-install
mkdir -p tmp/npm-pack tmp/npm-install/bin mkdir -p tmp/npm-pack tmp/npm-install/bin
npm pack ./npm/deskctl-cli --pack-destination ./tmp/npm-pack >/dev/null npm pack ./npm/deskctl --pack-destination ./tmp/npm-pack >/dev/null
@if [ "$$(uname -s)" != "Linux" ]; then \ @if [ "$$(uname -s)" != "Linux" ]; then \
echo "Skipping npm package runtime smoke test on non-Linux host."; \ echo "Skipping npm package runtime smoke test on non-Linux host."; \
else \ else \

View file

@ -1,6 +1,6 @@
# deskctl # deskctl
[![npm](https://img.shields.io/npm/v/deskctl-cli?label=npm)](https://www.npmjs.com/package/deskctl-cli) [![npm](https://img.shields.io/npm/v/deskctl?label=npm)](https://www.npmjs.com/package/deskctl)
[![release](https://img.shields.io/github/v/release/harivansh-afk/deskctl?label=release)](https://github.com/harivansh-afk/deskctl/releases) [![release](https://img.shields.io/github/v/release/harivansh-afk/deskctl?label=release)](https://github.com/harivansh-afk/deskctl/releases)
[![runtime](https://img.shields.io/badge/runtime-linux--x11-111827)](#support-boundary) [![runtime](https://img.shields.io/badge/runtime-linux--x11-111827)](#support-boundary)
[![skill](https://img.shields.io/badge/skills.sh-deskctl-111827)](skills/deskctl) [![skill](https://img.shields.io/badge/skills.sh-deskctl-111827)](skills/deskctl)
@ -10,7 +10,7 @@ Non-interactive desktop control for AI agents on Linux X11.
## Install ## Install
```bash ```bash
npm install -g deskctl-cli npm install -g deskctl
deskctl doctor deskctl doctor
deskctl snapshot --annotate deskctl snapshot --annotate
``` ```
@ -18,10 +18,11 @@ deskctl snapshot --annotate
One-shot execution also works: One-shot execution also works:
```bash ```bash
npx deskctl-cli --help npx deskctl --help
``` ```
`deskctl-cli` installs the `deskctl` command by downloading the matching GitHub Release asset for the supported runtime target. `deskctl` installs the command by downloading the matching GitHub Release asset for the supported runtime target.
## Installable skill ## Installable skill

View file

@ -12,14 +12,14 @@ GitHub Releases are the canonical binary source. The npm package consumes those
## Package Names ## Package Names
- crate: `deskctl` - crate: `deskctl`
- npm package: `deskctl-cli` - npm package: `deskctl`
- installed command: `deskctl` - installed command: `deskctl`
## Prerequisites ## Prerequisites
Before the first live publish on each registry: Before the first live publish on each registry:
- npm ownership for `deskctl-cli` - npm ownership for `deskctl`
- crates.io ownership for `deskctl` - crates.io ownership for `deskctl`
- repository secrets: - repository secrets:
- `NPM_TOKEN` - `NPM_TOKEN`

View file

@ -68,5 +68,3 @@ Treat these as useful but non-contractual:
- incidental text formatting in non-JSON mode - incidental text formatting in non-JSON mode
- default screenshot file names when no explicit path was provided - default screenshot file names when no explicit path was provided
- environment-dependent ordering details from the window manager - environment-dependent ordering details from the window manager
For the full repo copy, see `docs/runtime-contract.md`.

View file

@ -1,11 +1,11 @@
# deskctl-cli # deskctl
`deskctl-cli` installs the `deskctl` command for Linux X11 systems. `deskctl` installs the command for Linux X11 systems.
## Install ## Install
```bash ```bash
npm install -g deskctl-cli npm install -g deskctl
``` ```
After install, run: After install, run:
@ -17,7 +17,7 @@ deskctl --help
One-shot usage is also supported: One-shot usage is also supported:
```bash ```bash
npx deskctl-cli --help npx deskctl --help
``` ```
## Runtime Support ## Runtime Support
@ -26,7 +26,7 @@ npx deskctl-cli --help
- X11 session - X11 session
- currently packaged release asset: `linux-x64` - currently packaged release asset: `linux-x64`
`deskctl-cli` downloads the matching GitHub Release binary during install. `deskctl` downloads the matching GitHub Release binary during install.
Unsupported targets fail during install with a clear runtime support error instead of installing a broken command. Unsupported targets fail during install with a clear runtime support error instead of installing a broken command.
If you want the Rust source-install path instead, use: If you want the Rust source-install path instead, use:

View file

@ -17,7 +17,7 @@ function main() {
`Expected: ${binaryPath}`, `Expected: ${binaryPath}`,
`Package version: ${pkg.version}`, `Package version: ${pkg.version}`,
`Release tag: ${releaseTag(pkg)}`, `Release tag: ${releaseTag(pkg)}`,
"Try reinstalling deskctl-cli or check that your target is supported." "Try reinstalling deskctl or check that your target is supported."
].join("\n") ].join("\n")
); );
process.exit(1); process.exit(1);

View file

@ -1,7 +1,7 @@
{ {
"name": "deskctl-cli", "name": "deskctl",
"version": "0.1.6", "version": "0.1.6",
"description": "Installable deskctl CLI package for Linux X11 agents", "description": "Installable deskctl package for Linux X11 agents",
"license": "MIT", "license": "MIT",
"homepage": "https://github.com/harivansh-afk/deskctl", "homepage": "https://github.com/harivansh-afk/deskctl",
"repository": { "repository": {

View file

@ -44,6 +44,6 @@ async function main() {
} }
main().catch((error) => { main().catch((error) => {
console.error(`deskctl-cli install failed: ${error.message}`); console.error(`deskctl install failed: ${error.message}`);
process.exit(1); process.exit(1);
}); });

View file

@ -26,7 +26,7 @@ function supportedTarget(platform = process.platform, arch = process.arch) {
} }
throw new Error( throw new Error(
`deskctl-cli currently supports linux-x64 only. Received ${platform}-${arch}.` `deskctl currently supports linux-x64 only. Received ${platform}-${arch}.`
); );
} }

View file

@ -26,13 +26,13 @@ function main() {
} }
if (pkg.bin?.deskctl !== "bin/deskctl.js") { if (pkg.bin?.deskctl !== "bin/deskctl.js") {
throw new Error("deskctl-cli must expose the deskctl bin entrypoint."); throw new Error("deskctl must expose the deskctl bin entrypoint.");
} }
const target = supportedTarget("linux", "x64"); const target = supportedTarget("linux", "x64");
const targetPath = vendorBinaryPath(target); const targetPath = vendorBinaryPath(target);
const vendorDir = path.dirname(targetPath); const vendorDir = path.dirname(targetPath);
if (!vendorDir.endsWith(path.join("deskctl-cli", "vendor"))) { if (!vendorDir.endsWith(path.join("deskctl", "vendor"))) {
throw new Error("Vendor binary directory resolved unexpectedly."); throw new Error("Vendor binary directory resolved unexpectedly.");
} }
} }

View file

@ -16,10 +16,6 @@ import DocLayout from "../layouts/DocLayout.astro";
then verify. then verify.
</p> </p>
<pre><code>npm install -g deskctl-cli
deskctl doctor
deskctl snapshot --annotate</code></pre>
<h2>Start here</h2> <h2>Start here</h2>
<ul> <ul>
@ -33,6 +29,7 @@ deskctl snapshot --annotate</code></pre>
<ul> <ul>
<li><a href="/commands">Commands</a></li> <li><a href="/commands">Commands</a></li>
<li><a href="/architecture">Architecture</a></li> <li><a href="/architecture">Architecture</a></li>
<li><a href="/runtime-contract">Runtime contract</a></li>
</ul> </ul>
<h2>Agent skill</h2> <h2>Agent skill</h2>
@ -47,15 +44,13 @@ deskctl snapshot --annotate</code></pre>
<ul> <ul>
<li> <li>
<a href="https://www.npmjs.com/package/deskctl-cli">npm package</a> <a href="https://www.npmjs.com/package/deskctl">npm package</a>
</li> </li>
<li> <li>
<a href="https://github.com/harivansh-afk/deskctl">GitHub</a> <a href="https://github.com/harivansh-afk/deskctl">GitHub</a>
</li> </li>
<li> <li>
<a href="https://github.com/harivansh-afk/deskctl/releases"> <a href="https://github.com/harivansh-afk/deskctl/releases"> Releases </a>
GitHub releases
</a>
</li> </li>
</ul> </ul>
</DocLayout> </DocLayout>

View file

@ -9,17 +9,17 @@ toc: true
## Default install ## Default install
```sh ```sh
npm install -g deskctl-cli npm install -g deskctl
deskctl --help deskctl --help
``` ```
`deskctl-cli` is the default install path. It installs the `deskctl` command by `deskctl` is the default install path. It installs the command by
downloading the matching GitHub Release asset for the supported runtime target. downloading the matching GitHub Release asset for the supported runtime target.
## One-shot usage ## One-shot usage
```sh ```sh
npx deskctl-cli --help npx deskctl --help
``` ```
## Agent skill ## Agent skill

View file

@ -9,7 +9,7 @@ toc: true
## Install and diagnose ## Install and diagnose
```sh ```sh
npm install -g deskctl-cli npm install -g deskctl
deskctl doctor deskctl doctor
``` ```

View file

@ -1,7 +1,7 @@
--- ---
name: deskctl name: deskctl
description: Non-interactive X11 desktop control for AI agents. Use when the task involves controlling a Linux desktop - clicking, typing, reading windows, waiting for UI state, or taking screenshots inside a sandbox or VM. description: Non-interactive X11 desktop control for AI agents. Use when the task involves controlling a Linux desktop - clicking, typing, reading windows, waiting for UI state, or taking screenshots inside a sandbox or VM.
allowed-tools: Bash(deskctl:*), Bash(npx deskctl-cli:*), Bash(npm:*), Bash(which:*), Bash(printenv:*), Bash(echo:*) allowed-tools: Bash(deskctl:*), Bash(npx deskctl:*), Bash(npm:*), Bash(which:*), Bash(printenv:*), Bash(echo:*)
--- ---
# deskctl # deskctl
@ -13,7 +13,7 @@ All output follows the runtime contract defined in [references/runtime-contract.
## Quick start ## Quick start
```bash ```bash
npm install -g deskctl-cli npm install -g deskctl
deskctl doctor deskctl doctor
deskctl snapshot --annotate deskctl snapshot --annotate
``` ```