{"id":15102919,"url":"https://github.com/huakunshen/tauri-plugin-shellx","last_synced_at":"2025-10-22T22:31:49.417Z","repository":{"id":245026405,"uuid":"817041641","full_name":"HuakunShen/tauri-plugin-shellx","owner":"HuakunShen","description":"An unlocked modification of the original tauri-plugin-shell. Provide the option to bypass permission.","archived":false,"fork":false,"pushed_at":"2025-03-03T00:47:23.000Z","size":827,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-06T00:42:32.668Z","etag":null,"topics":["plugin","shell","tauri"],"latest_commit_sha":null,"homepage":"https://huakunshen.github.io/tauri-plugin-shellx/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HuakunShen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"HuakunShen","buy_me_a_coffee":"Huakun"}},"created_at":"2024-06-18T22:47:56.000Z","updated_at":"2025-07-16T10:53:11.000Z","dependencies_parsed_at":"2024-06-19T05:12:29.432Z","dependency_job_id":"86dc0e93-c6f6-48d2-8e2f-189863288a1a","html_url":"https://github.com/HuakunShen/tauri-plugin-shellx","commit_stats":null,"previous_names":["huakunshen/tauri-plugin-shellx"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/HuakunShen/tauri-plugin-shellx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuakunShen%2Ftauri-plugin-shellx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuakunShen%2Ftauri-plugin-shellx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuakunShen%2Ftauri-plugin-shellx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuakunShen%2Ftauri-plugin-shellx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HuakunShen","download_url":"https://codeload.github.com/HuakunShen/tauri-plugin-shellx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HuakunShen%2Ftauri-plugin-shellx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280526852,"owners_count":26345588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["plugin","shell","tauri"],"created_at":"2024-09-25T19:09:52.287Z","updated_at":"2025-10-22T22:31:49.114Z","avatar_url":"https://github.com/HuakunShen.png","language":"Rust","funding_links":["https://github.com/sponsors/HuakunShen","https://buymeacoffee.com/Huakun"],"categories":[],"sub_categories":[],"readme":"# Tauri Plugin Shellx\n\n\u003ch3 style=\"color:red;\"\u003eCurrently this plugin only supports Tauri v2\u003c/h3\u003e\n\n[![Deploy Docs](https://github.com/HuakunShen/tauri-plugin-shellx/actions/workflows/docs.yml/badge.svg)](https://github.com/HuakunShen/tauri-plugin-shellx/actions/workflows/docs.yml)\n\nThis is a mod of the original official Tauri plugin [tauri-plugin-shell](https://github.com/tauri-apps/tauri-plugin-shell).\n\nThe purpose is to provide the option to remove restrictions on shell commands (every command has to be pre-defined in capability).\n\n\u003e [!CAUTION]\n\u003e It is not recommended to use this plugin.\n\u003e This plugin was created for another project https://github.com/kunkunsh/kunkun, which contains an extension system.\n\u003e I implemented a custom permission control layer in JS to ensure security.\n\u003e You should use the original shell plugin unless there is a reason you have to unlock the permissions control.\n\nThis plugin allows you to execute any shell commands freely without any restrictions.\n\n## Docs\n\nJS/TS API Documentation: https://huakunshen.github.io/tauri-plugin-shellx/\n\n## Installation\n\n- NPM Package: https://www.npmjs.com/package/tauri-plugin-shellx-api\n- Rust Crate: https://crates.io/crates/tauri-plugin-shellx\n\n\u003ch4 style=\"color:red;\"\u003eMake sure your npm package version and rust crate version are the same, or you may encounter compatibility issues.\u003c/h4\u003e\n\n```bash\nnpm install tauri-plugin-shellx-api\ncargo add tauri-plugin-shellx\n```\n\n## Usage\n\nInstall rust crate from https://crates.io/crates/tauri-plugin-shellx\n\nInit plugin like this. The `init()` function takes a single `unlocked` argument.\n\n```rust\nlet unlocked = true;\ntauri::Builder::default()\n    .plugin(tauri_plugin_shellx::init(unlocked))\n...\n```\n\n- If set to true, capability and permission settings are ignored.\n- If set to false, it will work like the original `tauri-plugin-shell`.\n\n## Example\n\nAn example app can be found at [./examples/tauri-app](./examples/tauri-app).\n\nThis example app is a simplified terminal emulator.\n\n![](./assets/demo.png)\n\n## API\n\nAll API functions can be found in the [API documentation](https://huakunshen.github.io/tauri-plugin-shellx/).\n\n### Execute\n\n```ts\nconst cmd = Command.create('echo', ['echo', 'Hello, World!'])\nconst out = await cmd.execute()\nconst stdout = out.stdout\n// stdout === 'Hello, World!'\n```\n\n### Spawn\n\nSpawn a process for long-running tasks, and get stdout/stderr stream for real-time output.\n\n```ts\nconst cmd = Command.create('ffmpeg', [\n  '-i',\n  '/Users/xxx/input.mp4',\n  '/Users/xxx/output.mp4'\n])\n\ncmd.on('close', (data) =\u003e {\n  console.log(\n    `command finished with code ${data.code} and signal ${data.signal}`\n  )\n})\ncmd.on('error', (error) =\u003e console.error(`command error: \"${error}\"`))\ncmd.stdout.on('data', (line) =\u003e console.log(`command stdout: \"${line}\"`))\ncmd.stderr.on('data', (line) =\u003e console.log(`command stderr: \"${line}\"`))\n\nconst child = await cmd.spawn()\nconsole.log('pid:', child.pid)\nawait child.kill()\n```\n\n### Extra APIs\n\nExcept for the original APIs, this plugin also provides some additional APIs:\n\n#### Scripts Wrapper\n\n\u003e These functions are simply wrappers for the `execute` function, which can be used to execute scripts.\n\nYou can also construct your own script runner wrapper\n\n```ts\nconst powershellCmd = Command.create('powershell', ['-Command', script])\nconst bashCmd = Command.create('bash', ['-c', script])\n```\n\n- `makeBashScript`\n- `makePowershellScript`\n- `makeAppleScript`\n- `makePythonScript`\n- `makeZshScript`\n- `makeNodeScript`\n- `executeBashScript`\n- `executePowershellScript`\n- `executeAppleScript`\n- `executePythonScript`\n- `executeZshScript`\n- `executeNodeScript`\n\n#### Other Utilities\n\n- `likelyOnWindows`\n- `hasCommand`\n- `fixPathEnv`\n  - If the command you run cannot be found in the PATH environment variable, you can use this function to fix it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuakunshen%2Ftauri-plugin-shellx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuakunshen%2Ftauri-plugin-shellx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuakunshen%2Ftauri-plugin-shellx/lists"}