Skip to content

Commit

Permalink
[v2] add permission and capability cli docs (#2114)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Hyll <[email protected]>
  • Loading branch information
vasfvitor and simonhyll authored May 10, 2024
1 parent 9260ca6 commit ba54db3
Showing 1 changed file with 134 additions and 1 deletion.
135 changes: 134 additions & 1 deletion src/content/docs/references/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ For CLI commands related to developing plugins visit the [Develop a Tauri Plugin
| [`ios`](#ios) | iOS commands |
| [`android`](#android) | Android commands |
| [`migrate`](#migrate) | Migrate from v1 to v2 |
| [`permission`](#permission) | Manage permissions |
| [`capability`](#capability) | Manage permissions |
| [`help`](#help) | Print this message or the help of the given subcommand(s) |

## `build`
Expand Down Expand Up @@ -75,8 +77,10 @@ Options:
Space or comma separated list of features to activate
-b, --bundles [<BUNDLES>...]
Space or comma separated list of bundles to package.
Each bundle must be one of `deb`, `appimage`, `msi`, `app` or `dmg` on MacOS and `updater` on all platforms. If `none` is specified, the bundler will be skipped.
Each bundle must be one of `deb`, `appimage`, `msi`, `app` or `dmg` on MacOS and `updater` on all platforms.
Note that the `updater` bundle is not automatically added so you must specify it if the updater is enabled.
--no-bundle
Bundler will be skipped
-c, --config <CONFIG>
JSON string or path to JSON file to merge with tauri.conf.json
--ci
Expand Down Expand Up @@ -499,6 +503,135 @@ Options:
-V, --version Print version
```

## `permission`

<CommandTabs
npm="npm tauri permission"
yarn="yarn tauri permission"
pnpm="pnpm tauri permission"
cargo="cargo tauri permission"
/>

```
Permission commands
Usage: cargo tauri permission <COMMAND>
Commands:
new Create a new permission file
add Add a permission to capabilities
rm Remove a permission file, and its reference from any capability
ls List permissions available to your application
```

### `new`

Create a new permission file

```
Arguments:
[IDENTIFIER] Permission identifier
Options:
--description \<DESCRIPTION> Permission description
-v, --verbose... Enables verbose logging
-a, --allow \<ALLOW> List of commands to allow
-d, --deny \<DENY> List of commands to deny
--format \<FORMAT> Output file format [default: json] [possible values: json, toml]
-o, --out \<OUT> The output file
-h, --help Print help
-V, --version Print version
```

### `add`

Add a permission to capabilities

```
Arguments:
<IDENTIFIER> Permission to add
[CAPABILITY] Capability to add the permission to
Options:
-v, --verbose... Enables verbose logging
-h, --help Print help
-V, --version Print version
```

### `rm`

Remove a permission file, and its reference from any capability

```
Arguments:
<IDENTIFIER> Permission to remove
Options:
-v, --verbose... Enables verbose logging
-h, --help Print help
-V, --version Print version
```

### `ls`

List permissions available to your application

```
Arguments:
[PLUGIN] Name of the plugin to list permissions
Options:
-f, --filter \<FILTER> Permission identifier filter
-v, --verbose... Enables verbose logging
-h, --help Print help
-V, --version Print version
```


## `capability`

<CommandTabs
npm="npm tauri capability"
yarn="yarn tauri capability"
pnpm="pnpm tauri capability"
cargo="cargo tauri capability"
/>

```
Migrate from v1 to v2
Usage: cargo tauri capability [OPTIONS] <COMMAND>
Commands:
new Create a new permission file
help Print this message or the help of the given subcommand(s)
Options:
-v, --verbose... Enables verbose logging
-h, --help Print help
-V, --version Print version
```

### `new`

`Usage: cargo tauri capability new [OPTIONS] [IDENTIFIER]`

```
Arguments:
[IDENTIFIER] Capability identifier
Options:
--description <DESCRIPTION> Capability description
-v, --verbose... Enables verbose logging
--windows <WINDOWS> Capability windows
--permission <PERMISSION> Capability permissions
--format <FORMAT> Output file format [default: json] [possible values: json, toml]
-o, --out <OUT> The output file
-h, --help Print help
-V, --version Print version
```

## `help`

<CommandTabs
Expand Down

0 comments on commit ba54db3

Please sign in to comment.