@scopeide/cli 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +94 -0
  2. package/dist/index.js +1 -1
  3. package/package.json +14 -14
package/README.md ADDED
@@ -0,0 +1,94 @@
1
+ # @scopeide/cli
2
+
3
+ > **Scope** — The AI-first coding agent for your terminal.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@scopeide/cli.svg?style=flat-square)](https://www.npmjs.com/package/@scopeide/cli)
6
+ [![License](https://img.shields.io/badge/license-UNLICENSED-blue.svg?style=flat-square)](https://scopeide.com)
7
+ [![Website](https://img.shields.io/badge/website-scopeide.com-green.svg?style=flat-square)](https://scopeide.com)
8
+
9
+ Scope is an intelligent terminal assistant designed to build, edit, test, and troubleshoot code directly inside your terminal workspace.
10
+
11
+ ---
12
+
13
+ ## ⚡ Installation
14
+
15
+ Install globally using `npm`:
16
+
17
+ ```bash
18
+ npm install -g @scopeide/cli
19
+ ```
20
+
21
+ Or using `pnpm` / `yarn`:
22
+
23
+ ```bash
24
+ pnpm add -g @scopeide/cli
25
+ # or
26
+ yarn global add @scopeide/cli
27
+ ```
28
+
29
+ Verify your installation:
30
+
31
+ ```bash
32
+ scope --version
33
+ ```
34
+
35
+ ---
36
+
37
+ ## 🚀 Getting Started
38
+
39
+ ### 1. Authenticate
40
+ Log in with your Scope account to connect your credits and settings:
41
+
42
+ ```bash
43
+ scope login
44
+ ```
45
+
46
+ ### 2. Launch Interactive Agent
47
+ Navigate to any project directory and start an interactive session:
48
+
49
+ ```bash
50
+ scope
51
+ ```
52
+
53
+ ### 3. Headless / Direct Prompts
54
+ Run tasks directly from your command line:
55
+
56
+ ```bash
57
+ scope -p "Add unit tests for auth middleware"
58
+ ```
59
+
60
+ ---
61
+
62
+ ## 🛠️ Key Commands & Flags
63
+
64
+ | Command / Option | Description |
65
+ | :--- | :--- |
66
+ | `scope login` | Authenticate your terminal with Scope IDE |
67
+ | `scope logout` | Log out and clear saved credentials |
68
+ | `scope init` | Initialize project-level Scope configuration |
69
+ | `scope models` | List available AI models on your plan |
70
+ | `scope usage` | Check your monthly token and request usage |
71
+ | `scope doctor` | Check system environment and connection health |
72
+ | `scope -p, --prompt <text>` | Run a prompt directly and exit |
73
+ | `scope --plan` | Plan mode: analyze code and produce a step-by-step plan without modifying files |
74
+ | `scope -c, --continue` | Continue the most recent session in the current project |
75
+ | `scope -r, --resume [id]` | Resume an existing session |
76
+ | `scope --yolo` | Auto-approve tool calls for maximum velocity |
77
+
78
+ ---
79
+
80
+ ## 🔄 Updating Scope CLI
81
+
82
+ To update to the latest release at any time:
83
+
84
+ ```bash
85
+ npm install -g @scopeide/cli@latest
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 🌐 Links & Resources
91
+
92
+ - **Website:** [scopeide.com](https://scopeide.com)
93
+ - **Releases & Desktop Downloads:** [github.com/mdhedayet/scope-releases](https://github.com/mdhedayet/scope-releases/releases)
94
+ - **Support & Issues:** [support@scopeide.com](mailto:support@scopeide.com) / [GitHub Issues](https://github.com/mdhedayet/scope-releases/issues)
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import Ds from"dns";import Us from"net";import{Command as ji,Option as Ni}from"commander";var _={name:"Scope",shortName:"Scope",bin:"scope",dirName:".scope",keyPrefix:"sc_",sessionPrefix:"scs_",defaultApiUrl:"https://api.scopeide.com",installSnippet:"npm i -g @scopeide/cli",domain:"scopeide.com",supportEmail:"support@scopeide.com",salesEmail:"sales@scopeide.com",tagline:"The AI-First Code Editor Built for Flow & Speed.",version:"v0.1.7"};var L={maxSteps:100,hardMaxSteps:500,maxToolOutputBytes:12e3,maxContextTokens:32e3,warnContextTokens:24e3,maxRunTokens:0,charsPerToken:4};var jt={strings:{}},Xs=["maxSteps","hardMaxSteps","maxToolOutputBytes","maxContextTokens","warnContextTokens","maxRunTokens"];function wn(e){if(!e)return;let t=L;for(let n of Xs){let o=e.limits?.[n];typeof o=="number"&&Number.isFinite(o)&&o>=0&&(t[n]=o)}if(e.strings&&typeof e.strings=="object"){jt.strings={};for(let[n,o]of Object.entries(e.strings))/^(cli|agent|desktop)\./.test(n)&&typeof o=="string"&&(jt.strings[n]=o.slice(0,4e3))}}function l(e,t,...n){let o=jt.strings[e]??t;return n.length?o.replace(/\{(\d+)\}/g,(s,r)=>Number(r)<n.length?String(n[Number(r)]):s):o}var me={maxBytes:5*1024*1024,maxPerMessage:6,keepInRequest:3,maxRequestBytes:6*1024*1024};import Ne from"os";import xt from"path";import{execFile as _s,spawn as wi}from"child_process";import T from"fs/promises";import sr from"fs";import _o from"os";import rr from"crypto";import M from"path";import{spawn as ir}from"child_process";import{z as N}from"zod";import{zodToJsonSchema as ar}from"zod-to-json-schema";import Ve from"path";function pe(e,t){let n=Ve.resolve(e,t),o=Ve.relative(e,n),s=o===""||!o.startsWith("..")&&!Ve.isAbsolute(o);return{abs:n,inside:s}}function De(e,t){let n=Ve.posix.resolve(e,t),o=Ve.posix.relative(e,n),s=o===""||!o.startsWith("..")&&!Ve.posix.isAbsolute(o);return{abs:n,inside:s}}import Re from"path";function le(e,t){if(e.length<=t)return e;let n=Math.floor(t*.6),o=t-n;return`${e.slice(0,n)}
1
+ import Ds from"dns";import Us from"net";import{Command as ji,Option as Ni}from"commander";var _={name:"Scope",shortName:"Scope",bin:"scope",dirName:".scope",keyPrefix:"sc_",sessionPrefix:"scs_",defaultApiUrl:"https://api.scopeide.com",installSnippet:"npm i -g @scopeide/cli",domain:"scopeide.com",supportEmail:"support@scopeide.com",salesEmail:"sales@scopeide.com",tagline:"The AI-First Code Editor Built for Flow & Speed.",version:"v0.1.8"};var L={maxSteps:100,hardMaxSteps:500,maxToolOutputBytes:12e3,maxContextTokens:32e3,warnContextTokens:24e3,maxRunTokens:0,charsPerToken:4};var jt={strings:{}},Xs=["maxSteps","hardMaxSteps","maxToolOutputBytes","maxContextTokens","warnContextTokens","maxRunTokens"];function wn(e){if(!e)return;let t=L;for(let n of Xs){let o=e.limits?.[n];typeof o=="number"&&Number.isFinite(o)&&o>=0&&(t[n]=o)}if(e.strings&&typeof e.strings=="object"){jt.strings={};for(let[n,o]of Object.entries(e.strings))/^(cli|agent|desktop)\./.test(n)&&typeof o=="string"&&(jt.strings[n]=o.slice(0,4e3))}}function l(e,t,...n){let o=jt.strings[e]??t;return n.length?o.replace(/\{(\d+)\}/g,(s,r)=>Number(r)<n.length?String(n[Number(r)]):s):o}var me={maxBytes:5*1024*1024,maxPerMessage:6,keepInRequest:3,maxRequestBytes:6*1024*1024};import Ne from"os";import xt from"path";import{execFile as _s,spawn as wi}from"child_process";import T from"fs/promises";import sr from"fs";import _o from"os";import rr from"crypto";import M from"path";import{spawn as ir}from"child_process";import{z as N}from"zod";import{zodToJsonSchema as ar}from"zod-to-json-schema";import Ve from"path";function pe(e,t){let n=Ve.resolve(e,t),o=Ve.relative(e,n),s=o===""||!o.startsWith("..")&&!Ve.isAbsolute(o);return{abs:n,inside:s}}function De(e,t){let n=Ve.posix.resolve(e,t),o=Ve.posix.relative(e,n),s=o===""||!o.startsWith("..")&&!Ve.posix.isAbsolute(o);return{abs:n,inside:s}}import Re from"path";function le(e,t){if(e.length<=t)return e;let n=Math.floor(t*.6),o=t-n;return`${e.slice(0,n)}
2
2
  \u2026[${e.length-t} chars omitted]\u2026
3
3
  ${e.slice(e.length-o)}`}import yn from"path";var Zs=[[/(^|[\s;&|(`])(sudo|doas)\b/,"sudo is not allowed"],[/(^|[\s;&|(`])su\s+(-|root\b)/,"su is not allowed"],[/:\(\)\s*\{\s*:\s*\|\s*:\s*&\s*\}\s*;\s*:/,"fork bomb"],[/\bmkfs(\.\w+)?\b/,"filesystem format"],[/\b(wipefs|shred|fdisk|parted|diskutil\s+(erase|zero|secure))/,"disk wipe/partition command"],[/\bdd\b[^|;&]*\bof=\/dev\//,"raw disk write"],[/>\s*\/dev\/(sd|nvme|disk|rdisk|hd)/,"raw disk write"],[/(^|[\s;&|(`])(shutdown|reboot|halt|poweroff)\b/,"system power command"],[/\bchmod\s+(-\w+\s+)*[0-7]*777\s+\/(\s|$)/,"chmod 777 on root path"],[/\b(curl|wget|nc|ncat|scp|rsync|ftp|sftp)\b[^\n]*(\.env\b|id_rsa|id_ed25519|\.ssh\b|\.aws\b|\.npmrc|\.netrc|credentials|\.forge\/config)/,"possible secret exfiltration"],[/\b(cat|less|more|head|tail|base64|printenv|env)\b[^\n]*\|\s*(curl|wget|nc|ncat)\b/,"possible secret exfiltration"],[/\b(cat|head|tail|base64)\b[^\n|]*(\.env\b|id_rsa|\.ssh\/|\.aws\/|\.netrc)[^\n]*\|\s*(curl|wget|nc|ncat)\b/,"possible secret exfiltration"],[/\b(curl|wget)\b[^\n]*\$\{?\w*(KEY|TOKEN|SECRET|PASSWORD)\w*/i,"possible secret exfiltration"],[/\b(printenv|env)\b[^\n]*\|\s*(curl|wget|nc|ncat)\b/,"possible secret exfiltration"],[/\b(curl|wget)\b[^\n]*\|\s*(sudo\s+)?(sh|bash|zsh|python3?|node)\b/,"piping a remote script to an interpreter"]],Qs=/^(\/|\/\*|~|~\/|~\/\*|\$HOME|\$\{HOME\}|\$HOME\/|\$HOME\/\*|\*|\/(usr|etc|bin|sbin|var|lib|opt|home|Users|System|Library|Applications)\/?\*?)$/;function er(e){let t=e.trim().split(/\s+/),n=t.findIndex(c=>yn.basename(c.replace(/^["']|["']$/g,""))==="rm");if(n<0)return null;let o=t.slice(n+1);if(!o.some(c=>/^-[a-zA-Z]*[rR][a-zA-Z]*$/.test(c)||c==="--recursive"))return null;if(o.includes("--no-preserve-root"))return"rm --no-preserve-root";let a=o.filter(c=>!c.startsWith("-")).map(c=>c.replace(/^["']|["']$/g,"")).find(c=>Qs.test(c));return a?`recursive delete of "${a}"`:null}function Nt(e,t){for(let[n,o]of Zs)if(n.test(e))return{ok:!1,reason:`blocked: ${o}`};for(let n of e.split(/&&|\|\||[;|\n]/)){let o=er(n);if(o)return{ok:!1,reason:`blocked: ${o}`}}if(!t.allowAll){let n=t.posix?yn.posix:yn,o=n.relative(t.root,t.cwd);if(o.startsWith("..")||n.isAbsolute(o))return{ok:!1,reason:"blocked: cwd is outside the project root"}}return{ok:!0}}var tr=/(KEY|TOKEN|SECRET|PASSWORD|PASSWD|CREDENTIAL)/i;function It(e){let t={};for(let[n,o]of Object.entries(e))tr.test(n)||n.startsWith("FORGE_")||n==="DATABASE_URL"||(t[n]=o);return t}var nr=1e6,bn=(e,t=L.maxToolOutputBytes)=>le(e,t);function Te(e,t,n){let{abs:o,inside:s}=De(e.root,t);if(e.allowAll)return o;if(!s){if(n&&e.allowOutside)return o;throw new Error(l("agent.tools.path_0_is_outside_the",'path "{0}" is outside the project root',t))}if(n&&Re.posix.relative(e.root,o).split("/").includes(".git"))throw new Error(l("agent.tools.modifying_git_is_not_allowed","modifying .git is not allowed"));return o}async function po(e,t,n){let o=await e.stat(t);if(!o)throw new Error(l("agent.tools.file_not_found_0","file not found: {0}",n));if(o.isDir)throw new Error(l("agent.tools.0_is_a_directory_use","{0} is a directory; use list_dir",n));if(o.size>nr)throw new Error(l("agent.tools.0_is_too_large_1","{0} is too large ({1} bytes); use grep to find the relevant part",n,o.size));let s=await e.readFile(t);if(s.includes(0))throw new Error(l("agent.tools.0_looks_like_a_binary","{0} looks like a binary file",n));return s.toString("utf8")}var or=(e,t)=>e.slice(0,t).split(`
4
4
  `).length;async function go(e,t,n){let o=n.remote;switch(e){case"read_file":return bn(await po(o,Te(n,t.path,!1),t.path));case"write_file":{let s=Te(n,t.path,!0),r=await o.stat(s);if(r?.isDir)throw new Error(l("agent.tools.0_is_a_directory","{0} is a directory",t.path));return await o.writeFile(s,t.content),l("agent.tools.wrote_file","{0} {1} ({2} chars)",r?"overwrote":"created",t.path,t.content.length)}case"edit_file":{let s=Te(n,t.path,!0),r=await po(o,s,t.path),{old_string:a,new_string:c}=t;if(a===c)throw new Error(l("agent.tools.old_string_and_new_string","old_string and new_string are identical"));!r.includes(a)&&r.includes(`\r
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@scopeide/cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Scope — the AI coding agent for your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
7
7
  "homepage": "https://scopeide.com",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/mdhedayet/forgecode.git",
11
- "directory": "apps/cli"
10
+ "url": "git+https://github.com/mdhedayet/scope-releases.git"
12
11
  },
13
12
  "bugs": {
13
+ "url": "https://github.com/mdhedayet/scope-releases/issues",
14
14
  "email": "support@scopeide.com"
15
15
  },
16
16
  "keywords": [
@@ -25,7 +25,8 @@
25
25
  },
26
26
  "files": [
27
27
  "bin/scope.js",
28
- "dist"
28
+ "dist",
29
+ "README.md"
29
30
  ],
30
31
  "engines": {
31
32
  "node": ">=22"
@@ -33,13 +34,6 @@
33
34
  "publishConfig": {
34
35
  "access": "public"
35
36
  },
36
- "scripts": {
37
- "start": "tsx src/index.ts",
38
- "build": "tsup",
39
- "typecheck": "tsc -p .",
40
- "test": "vitest run",
41
- "prepublishOnly": "tsup"
42
- },
43
37
  "dependencies": {
44
38
  "commander": "^12.1.0",
45
39
  "zod": "^3.24.1",
@@ -47,7 +41,13 @@
47
41
  },
48
42
  "devDependencies": {
49
43
  "tsup": "^8.3.5",
50
- "@forgecode/agent-core": "workspace:*",
51
- "@forgecode/shared": "workspace:*"
44
+ "@forgecode/shared": "0.1.0",
45
+ "@forgecode/agent-core": "0.1.0"
46
+ },
47
+ "scripts": {
48
+ "start": "tsx src/index.ts",
49
+ "build": "tsup",
50
+ "typecheck": "tsc -p .",
51
+ "test": "vitest run"
52
52
  }
53
- }
53
+ }