返回资讯中心
外部精选
软件工程
#开发者实时流

Show HN: Slashi – one / popup for files, settings, Git and scripts in VS Code

One keyboard-first popup for your files, settings, extensions, Git, terminal, project scripts and AI, plus the commands you build yourself.

Hacker News 最新meness2026/10/21 · 25 天前25 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Do anything in VS Code. Just type /

One keyboard-first popup for your files, settings, extensions, Git, terminal, project scripts and AI, plus the commands you build yourself.

Install

Where How

VS Code Marketplace Install from the Marketplace, or search Slashi in the Extensions view

Open VSX (VSCodium and other editors that use Open VSX) Install from Open VSX

Command line code --install-extension meness.slashi

VSIX file Download slashi-<version>.vsix from the latest release, then Extensions → … → Install from VSIX…

Slashi needs VS Code 1.90 or newer. On first launch, a short onboarding sets up the shortcut, your providers and AI.

Press Cmd / on macOS or Ctrl / on Windows and Linux, then type.

Do this Keys

Open Slashi Cmd / (macOS) · Ctrl / (Windows/Linux)

Move ↑ ↓ (or Ctrl N / Ctrl P)

Run Enter

Complete a command, then type its arguments Tab, e.g. /run → Tab → npm test

Run the last command again, with the same arguments /again

Actions menu (rename, delete, copy path, hide, bind a key…) Shift Enter or →

First action (e.g. open a file to the side) Alt Enter

Hand what you typed to AI Cmd Enter / Ctrl Enter

Clear, then close Esc

Do with AI from anywhere Ctrl Cmd / (macOS) · Ctrl Shift Alt /

Type / plus a scope and a space to search one area only:

/f files · /p project · /npm scripts · /set settings · /ext extensions · /git · /term · /ai · /do · /tx text · /tab open tabs · /@ symbols · /err problems · /theme · /web · /my your commands · /market

In Markdown, plain text and the Git commit box, typing / at the start of a line suggests slash commands inline.

Everything in the list comes from a provider. You can turn off a whole provider, or single features inside one: for example, keep Marketplace search but hide installed extensions. Use the Studio (/studio), the picker (/providers) or settings.

Other extensions can add providers of their own (for example /jira). They show up in Studio with the extension's name and turn off the same way.

With slashi.ai.provider set to auto (the default), Slashi uses the first of these it finds:

Switch models with /models, and test the connection in Studio → AI & Models. Standing instructions go in slashi.ai.customInstructions.

  1. The wizard

/new-command asks for a name and steps, then saves the command to your settings or to the team file. No JSON needed.

Add commands to slashi.customCommands (user settings), or to .vscode/slashi.json to share them with everyone on the repo. The bundled JSON schema gives you autocomplete and validation.

// .vscode/slashi.json { "$schema": "https://raw.githubusercontent.com/meness/slashi/main/schemas/slashi.schema.json", "commands": [ { "name": "ship", "title": "Ship It", "icon": "rocket-launch", "args": "commit message", "steps": [ { "command": "workbench.action.files.saveAll" }, { "slash": "/test" }, { "terminal": "git add -A && git commit -m ${q:args} && git push" }, { "notify": "Shipped 🚀" } ] } ] }

Step Example

command { "command": "editor.action.formatDocument" } (optional args)

slash { "slash": "/run npm test" }

terminal { "terminal": "npm run build", "cwd": "packages/web" }

setting { "setting": "editor.fontSize", "value": 18, "target": "user" }

insert { "insert": "// TODO(${env:USER}): " }

open { "open": "https://github.com/${input:repo}" } or a workspace path

ai { "ai": "Translate to German: ${selection}", "output": "replace" } (panel · replace · insert)

notify { "notify": "Done" }

input / pick { "input": "Ticket?", "var": "ticket" } → ${input:ticket}; { "pick": ["patch","minor"], "var": "bump" }

wait { "wait": 500 }

Variables: ${args}, ${selection}, ${file}, ${fileBasename}, ${fileBasenameNoExtension}, ${fileDirname}, ${fileExtname}, ${relativeFile}, ${workspaceFolder}, ${lineNumber}, ${language}, ${date}, ${time}, ${datetime}, ${uuid}, ${clipboard}, ${env:NAME}, ${config:setting.key}, ${input:var}. Add a default with ${args:3000}. Prefix with q: for shell-safe quoting, e.g. ${q:selection}.

Team files and packs ask first. When a team or pack command would run terminal, VS Code or slash commands, change settings or open links, Slashi shows those steps and asks. Always Allow skips the question until the steps change. In them, ${env:NAME}, ${config:…} and ${clipboard} expand only in insert and notify steps, so secrets stay in the editor. In untrusted workspaces, workspace-defined commands are ignored.

/market lists action packs: Git Power Moves, AI Writing Tools, Focus & Present, Web Dev Toolkit, Handy Inserts and more. Packs built by Slashi carry a verified seal, and every download is checked against its registry listing before it installs. Before you install a pack, Slashi shows every step in it and marks the ones that can run commands. /export-pack turns your commands into a pack.

Action macOS Windows / Linux

Open Slashi Cmd / Ctrl /

Do with AI Ctrl Cmd / Ctrl Shift Alt /

Toggle line comment (moved by Slashi) Cmd Alt / Ctrl Alt /

To keep VS Code’s default comment shortcut, turn off slashi.shortcut.useSlashKey. Slashi then opens with Cmd Shift ; (macOS) or Ctrl Shift /. You can rebind everything in Keyboard Shortcuts (/shortcuts), separately per OS, and give any slash command its own key:

// keybindings.json { "key": "cmd+alt+u", "command": "slashi.run", "args": "/upper" }, { "key": "cmd+alt+g", "command": "slashi.open", "args": "/git " }, { "key": "cmd+alt+t", "command": "slashi.run", "args": "/run npm test" }

Scoped entry points such as slashi.openFiles, slashi.openGit, slashi.openProject, slashi.openAI and slashi.doWithAI can be bound too. Every result’s actions menu also has Assign a keyboard shortcut….

Setting Default

slashi.popup.style spotlight spotlight (custom design) or native (VS Code Quick Pick, follows every accessibility setting)

slashi.shortcut.useSlashKey true Cmd/Ctrl / opens Slashi; the comment toggle moves to Cmd/Ctrl Alt /

slashi.providers.* true Turn each provider on or off

slashi.disabledProviders [] Providers from other extensions that are turned off

slashi.disabledFeatures [] Turn off single features, e.g. extensions.installed

slashi.hiddenCommands [] Hide single results (supports a trailing *)

slashi.inlineTrigger.languages markdown, plaintext, scminput Where / at line start suggests commands (* = everywhere)

slashi.ai.provider / model / baseUrl auto AI backend

slashi.ai.confirmBeforeRun true Confirm Do-with-AI plans. Steps that can reach a shell always ask

slashi.ai.customInstructions "" Extra instructions for every AI request

slashi.customCommands [] Your commands

slashi.marketplace.registries this repo Registry index URLs (HTTPS)

slashi.files.maxIndexed 20000 File index size

The AI backend, model, URL, effort, custom instructions, plan confirmation, web search engines and registry settings are machine-scoped: only your user settings can change them, never a repository’s workspace settings. Search @ext:meness.slashi in Settings for the rest.

No telemetry. Slashi collects nothing.

API keys live only in VS Code Secret Storage. A repository can’t change your AI backend, its URL, your instructions or your confirmation setting, so it can’t send your key or code to another server.

AI requests go only to the backend you chose. Do-with-AI plans can use only real commands and settings. With slashi.ai.confirmBeforeRun off, a plan still asks before any step that can reach a shell: terminal commands, project scripts, custom commands, and settings that change what runs or what is trusted (Slashi, terminal, task, tool path, workspace trust, proxy and agent auto-approve settings).

Action packs are fetched only over HTTPS, previewed step by step before installing, and checked against their registry listing. Only packs built by Slashi carry the verified seal.

Webviews use a strict nonce-based Content Security Policy and load only bundled files. Raw HTML in model output is escaped, never rendered.

Untrusted workspaces: workspace-defined commands are ignored. Team commands (in .vscode/slashi.json or the workspace's slashi.customCommands) and packs ask before running anything that can reach a shell.

See SECURITY.md to report a vulnerability.

The popup ranks local results itself, so typing doesn't wait on the extension host. Only big catalogues, such as workspace files, are ranked in the host. The index is lowercased up front, a subsequence check skips non-matches early, and highlights are computed only for visible rows. esbuild bundles the extension, and the Anthropic SDK loads only when you first use Claude.

For extension authors, teams and pack publishers. The full guide is docs/BUILDING_ACTIONS.md.

const slashi = await vscode.extensions.getExtension('meness.slashi')?.activate(); slashi?.registerCommand({ extensionId: 'acme.deploy', name: 'deploy', title: 'Deploy to Staging', icon: 'rocket-launch', args: 'service', run: (service) => deploy(service), });

Add a whole provider with registerProvider (Slashi 0.5.0+): your own results under your own scope, such as /jira listing your tickets. See Providers.

Contributing

Bug reports, ideas, action packs and pull requests are welcome. You need Node 20+ and VS Code 1.90+:

git clone https://github.com/meness/slashi && cd slashi npm ci npm run check # what CI runs: typecheck, lint, format, unit and smoke tests, pack validation

Press F5 (Run Slashi) to start an Extension Development Host with your build. CONTRIBUTING.md has the project layout, every script, the testing guide and how releases work.

Slashi is free and open source. If it saves you time, you can support its development with a crypto donation (ETH, Polygon, BTC or SOL). The addresses are in DONATE.md. Stars, reviews and bug reports help a lot too.

Inside VS Code, Studio → Help & Support (/help-center) collects the docs, troubleshooting, feedback links and /support. When you report a bug, run /diagnostics and paste the result. It copies versions and setup only, never keys, file names or code.

MIT © meness and Slashi contributors. Icons by Phosphor Icons (MIT). See THIRD_PARTY_NOTICES.md.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →