Skip to content

Commit d1ccacb

Browse files
committed
chore: updating secrets commands to match current implementation
chore: updated vaults commands chore: updated grammar
1 parent 213051d commit d1ccacb

File tree

4 files changed

+310
-200
lines changed

4 files changed

+310
-200
lines changed

Diff for: docs/reference/polykey-cli/commands/README.md

+60-58
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ The bootstrap subcommand solely deals with the construction of the state of poly
1919
The supplied or assumed node path must exist and be empty for a successful execution, otherwise the command will exit with code [EX_USAGE (64)].
2020

2121
| Command | Description | Level | Interaction |
22-
| --------- | ----------------------------------------- | ----- | ----------- |
23-
| bootstrap | Initializes a PolyKey node at a node path | 1 | Local |
22+
|-----------|-------------------------------------------|-------|-------------|
23+
| bootstrap | Initializes a Polykey node at a node path | 1 | Local |
2424

2525
### Agent
2626

2727
The agent subcommand allows control over the Polykey agent process.
2828

2929
| Command | Description | Level | Interaction |
30-
| ------- | --------------------------------------- | ----- | ----------- |
31-
| start | Starts the PolyKey Agent | 1 | Local |
32-
| stop | Stops the PolyKey Agent | 1 | Local |
33-
| status | Gets the status of the PolyKey Agent | 1 | Local |
30+
|---------|-----------------------------------------|-------|-------------|
31+
| start | Starts the Polykey Agent | 1 | Local |
32+
| stop | Stops the Polykey Agent | 1 | Local |
33+
| status | Gets the status of the Polykey Agent | 1 | Local |
3434
| unlock | Starts a session for the current client | 1 | Local |
3535
| lock | Locks the current client session | 1 | Local |
3636
| lockall | Locks all active sessions on the agent | 1 | Local |
@@ -39,38 +39,38 @@ The agent subcommand allows control over the Polykey agent process.
3939

4040
The vaults subcommand will deal with CRUD (Create, read, update and delete) operations on Polykey vaults.
4141

42-
| Command | Description | Level | Interaction |
43-
| ----------- | ----------------------------------- | ----- | ----------- |
44-
| create | Creates a new vault | 1 | Local |
45-
| delete | Deletes an existing vault | 1 | Local |
46-
| list | Lists all existing vaults | 1 | Local |
47-
| rename | Renames an existing vault | 1 | Local |
48-
| stats | Gets the stats of an existing vault | 1 | Local |
49-
| share | Shares vaults with a gestalt | 1 | Local |
50-
| unshare | Unshares vaults with a gestalt | 1 | Local |
51-
| permissions | Gets the permissions for a vault | 1 | Local |
52-
| pull | Pulls a vault from another node | 1 | Agent-Agent |
53-
| scan | Lists the vaults of another node | 1 | Agent-Agent |
54-
| clone | Clones a vault from another node | 1 | Agent-Agent |
42+
| Command | Description | Level | Interaction |
43+
|--------------|-------------------------------------|-------|-------------|
44+
| create | Creates a new vault | 1 | Local |
45+
| rm \| remove | Removes an existing vault | 1 | Local |
46+
| ls \| list | Lists all existing vaults | 1 | Local |
47+
| rename | Renames an existing vault | 1 | Local |
48+
| stats | Gets the stats of an existing vault | 1 | Local |
49+
| share | Shares vaults with a gestalt | 1 | Local |
50+
| unshare | Unshares vaults with a gestalt | 1 | Local |
51+
| permissions | Gets the permissions for a vault | 1 | Local |
52+
| pull | Pulls a vault from another node | 1 | Agent-Agent |
53+
| scan | Lists the vaults of another node | 1 | Agent-Agent |
54+
| clone | Clones a vault from another node | 1 | Agent-Agent |
5555

5656
### Secrets
5757

5858
The secrets subcommand will deal with CRUD (Create, read, update and delete) operations on secrets within a Polykey vault.
5959

6060
As secrets subcommands are performed within a single vault, paths are specified using the following notation `<vaultName>:<secretPath>`. As each vault maintains separate filesystems, secrets cannot be transferred across vaults.
6161

62-
| Command | Description | Level | Interaction |
63-
| ------- | ------------------------------------------------ | ----- | ----------- |
64-
| create | Creates a new secret | 1 | Local |
65-
| delete | Deletes an existing secret | 1 | Local |
66-
| edit | Edits an existing secret | 1 | Local |
67-
| get | Gets the contents of an existing secret | 1 | Local |
68-
| list | Lists the secrets within an existing vault | 1 | Local |
69-
| mkdir | Makes a directory inside an existing vault | 1 | Local |
70-
| dir | Adds a directory of secrets to an existing vault | 1 | Local |
71-
| rename | Renames an existing secret | 1 | Local |
72-
| update | Updates an existing secret with new content | 1 | Local |
73-
| env | Injects existing secrets into an environment | 2 | Local |
62+
| Command | Description | Level | Interaction |
63+
|--------------|-----------------------------------------------------------------------|-------|-------------|
64+
| create | Creates a new secret | 1 | Local |
65+
| rm \| remove | Removes an existing secret | 1 | Local |
66+
| ed \| edit | Edits an existing secret or creates one if it doesn't exist | 1 | Local |
67+
| cat | Gets the contents of one or more secrets | 1 | Local |
68+
| ls \| list | Lists the secrets within an existing directory | 1 | Local |
69+
| mkdir | Makes a directory inside an existing vault | 1 | Local |
70+
| dir | Adds a directory of secrets to an existing vault | 1 | Local |
71+
| rename | Renames an existing secret | 1 | Local |
72+
| write | Updates an existing secret with new content taken from standard input | 1 | Local |
73+
| env | Injects existing secrets into an environment | 2 | Local |
7474

7575
### Keys
7676

@@ -83,7 +83,7 @@ Encryption using the root keypair has a size limit depending on the size of the
8383
For signature and verification using the root keypair, the data and signature will be input and output separately. In the future, this will be done using a specific file format which allows the signature and data to be compiled into one file.
8484

8585
| Command | Description | Level | Interaction |
86-
| --------- | ------------------------------------------- | ----- | ----------- |
86+
|-----------|---------------------------------------------|-------|-------------|
8787
| cert | Gets the root certificate | 1 | Local |
8888
| certchain | Get the certificate chain | 1 | Local |
8989
| root | Get the root keypair | 1 | Local |
@@ -99,38 +99,40 @@ For signature and verification using the root keypair, the data and signature wi
9999

100100
The node subcommand allows manipulation of Polykey's peer-to-peer system.
101101

102-
| Command | Description | Level | Interaction |
103-
| --------------- | ---------------------------------------- | ----- | ----------- |
104-
| add | Adds a node to the node graph | 1 | Local |
105-
| delete(Removed) | Deletes a node from the node graph | 1 | Local |
106-
| get(Removed) | Gets the node info for a particular node | 1 | Local |
107-
| claim | Makes a claim to a node | 1 | Agent-Agent |
108-
| unclaim | Removes a claim to a ndoe | 1 | Agent-Agent |
109-
| find | Attempts to find a node in the DHT | 1 | Agent-Agent |
110-
| ping | Pings a node to check if it is online | 1 | Agent-Agent |
102+
| Command | Description | Level | Interaction |
103+
|-------------|---------------------------------------|-------|-------------|
104+
| add | Adds a node to the node graph | 1 | Local |
105+
| connections | Lists all active node connections | 1 | Agent |
106+
| claim | Makes a claim to a node | 1 | Agent-Agent |
107+
| find | Attempts to find a node in the DHT | 1 | Agent-Agent |
108+
| ping | Pings a node to check if it is online | 1 | Agent-Agent |
109+
| getall | Gets all nodes from the node graph | 1 | Agent-Agent |
111110

112111
### Identities
113112

114113
The identities subcommand allows control over the node's identity and its links with other social identities.
115114

116-
| Command | Description | Level | Interaction |
117-
| ------------ | ------------------------------------------------------------------- | ----- | ----------- |
118-
| claim | Claim an identity for this keynode | 1 | Local |
119-
| authenticate | Authenticate a social identity provider (Github only) | 1 | Local |
120-
| get | Gets the gestalt of a node or identity | 1 | Local |
121-
| list | Lists the available gestalts | 1 | Local |
122-
| trust | Trusts a node id or identity | 1 | Local |
123-
| untrust | Untrusts a node id or identity | 1 | Local |
124-
| search | Searches the provider for a connected identity | 1 | Local |
125-
| allow | Set a specific permission for a Node or Identity | 2 | Local |
126-
| disallow | Remove a Specific permission for a Node or Identity | 2 | Local |
127-
| discover | Starts discovery process using Node or Identity as a starting point | 1 | Agent-Agent |
128-
| perms | Gets the permisson for an node or identity | 1 | Local |
115+
| Command | Description | Level | Interaction |
116+
|---------------|---------------------------------------------------------------------|-------|-------------|
117+
| claim | Claim an identity for this keynode | 1 | Local |
118+
| authenticate | Authenticate a social identity provider (Github only) | 1 | Local |
119+
| get | Gets the gestalt of a node or identity | 1 | Local |
120+
| list | Lists the available gestalts | 1 | Local |
121+
| trust | Trusts a node id or identity | 1 | Local |
122+
| untrust | Untrusts a node id or identity | 1 | Local |
123+
| search | Searches the provider for a connected identity | 1 | Local |
124+
| allow | Set a specific permission for a node or an identity | 2 | Local |
125+
| disallow | Remove a specific permission for a node or identity | 2 | Local |
126+
| discover | Starts discovery process using node or identity as a starting point | 1 | Agent-Agent |
127+
| permissions | Gets the permission for a node or an identity | 1 | Local |
128+
| queue | Prints out vertices queued for discovery | 1 | Local |
129+
| invite | Invites another keynode | 1 | Local |
130+
| authenticated | Lists all authenticated identities across all providers | 1 | Local |
129131

130132
### Notifications
131133

132134
| Command | Description | Level | Interaction |
133-
| ------- | ----------------------------------------------- | ----- | ----------- |
135+
|---------|-------------------------------------------------|-------|-------------|
134136
| send | Sends a notification to another node | 1 | Agent-Agent |
135137
| read | Displays notifications and marks them as "read" | 1 | Local |
136138
| clear | Clears all read and unread notifications | 1 | Local |
@@ -139,10 +141,10 @@ The identities subcommand allows control over the node's identity and its links
139141

140142
- Toggles should be `-f` `-v` flags that when used are `true` and when not used are `false`. These can be joined up together like `-fv`, but this may be confusing with the multiword options, and in which case I usually don't use the joined up versions. Flags should be sparing, users should not need to remember every flag they need to do something.
141143
- Options should ideally be optional `--key value` and `-k value`. In some cases they represent key-value parameters which are not optional. Make sure that multi-word options are like `--multi-word` and their short form is `-mw`.
142-
- Parameters should be positional so `pk subcommand param1 param2`, in that case they are usually not optional and are required, it is possible to have arbitrary arity of parameters so you can have 1, or many.
143-
- Exception is `pk subcommand -k value -k2 value -k3 value`, which is a key value parameters, this would not be optional, but in many cases if the commands are designed well, you should be able to have all values as parameters.
144+
- Parameters should be positional so `polykey subcommand param1 param2`, in that case they are usually not optional and are required, it is possible to have arbitrary arity of parameters so you can have 1, or many.
145+
- Exception is `polykey subcommand -k value -k2 value -k3 value`, which is a key value parameters, this would not be optional, but in many cases if the commands are designed well, you should be able to have all values as parameters.
144146

145-
Make sure you're using the output formatting functions in the `src/bin/utils.ts` (or at least that's where I had them last). This ensures you have a consistent set outputs, whether it is a list, table, json or otherwise. We can have `-f` to indicate different output formats for these.
147+
Make sure you're using the output formatting functions in the `src/bin/utils.ts`. This ensures you have a consistent set outputs, whether it is a list, table, json or otherwise. We can have `-f` to indicate different output formats for these.
146148

147149
And for testing, try to use the `main` exported function, but I think as you said on slack there are new methods that make it easier to test these that might have been created by @DrFacepalm or @scottmmorris.
148150

0 commit comments

Comments
 (0)