Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New commands layout #75

Merged
merged 29 commits into from
Sep 30, 2022
Merged
Changes from 15 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
59c2189
first small draft of the commands layout
volovyks Nov 2, 2021
7579dd1
helper commands moved to a separate extensions in doc
volovyks Nov 3, 2021
f3f9a87
commands in proposal renamed
volovyks Nov 3, 2021
9c5c30a
Update docs/NEW_GUIDE_DRAFT.en.md
volovyks Nov 3, 2021
b3733c7
Update docs/NEW_GUIDE_DRAFT.en.md
volovyks Nov 3, 2021
bb5ccaf
NEW-GUIDE updated accoring to the comments
volovyks Nov 4, 2021
d19cdb1
function calls renamed to method calls in doc
volovyks Nov 4, 2021
2b42e8b
new commands proposal refactored
volovyks Nov 4, 2021
6479f32
multiple acc import options added to the doc
volovyks Nov 4, 2021
67c8588
config commands added to the doc
volovyks Nov 4, 2021
1f882db
command structure in doc updated
volovyks Nov 5, 2021
f01617f
network name added as a parameter to manage-connections doc
volovyks Nov 5, 2021
433bf62
CLI UX principles added
volovyks Nov 5, 2021
35a3116
new cli interface md file formatted
volovyks Nov 5, 2021
f94cfdc
paramtere added to new cli interface doc
volovyks Nov 5, 2021
8f025f2
new commands layout updated
volovyks Nov 18, 2021
b77db3d
new commands design update
volovyks Nov 18, 2021
c15bcfe
new commadns design updated
volovyks Nov 18, 2021
87346d5
import-account replaced
volovyks Nov 19, 2021
0aedf98
account added to the tope level of the cli design
volovyks Nov 19, 2021
0e29834
new layout proposal
frol May 7, 2022
c267b9b
Update NEW_NEAR_CLI_INTERFACE.md
frol May 10, 2022
22dc8ea
more extension ideas added
volovyks May 13, 2022
85393f6
Update docs/NEW_NEAR_CLI_INTERFACE.md
volovyks May 16, 2022
f1446fa
Update NEW_NEAR_CLI_INTERFACE.md
frol May 16, 2022
78f0a05
updated `autogenerate-new-keypair` subcommand
frol May 17, 2022
238763d
just updated text formatting
frol May 17, 2022
207485b
moved inspect-storage to the developer extension
frol Jul 12, 2022
76ef27b
extended `add-key` with the parameters to specify the kind of access key
frol Jul 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions docs/NEW_NEAR_CLI_INTERFACE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# New NEAR CLI interface

`NEAR CLI` is using `extensions` to saticfy all groups of users.
volovyks marked this conversation as resolved.
Show resolved Hide resolved
- `Core NEAR CLI` commands should be usefull for all groups of users.
- `Core NEAR CLI` is a single binary, there is no extensions that are installed `by default`.
- Each extension is a separate binary that can be executed from `NEAR CLI`.
- Extensions are used by a particular group or several groups of users.
- Extensions are not composable (you should not create extensions for extensions).

`NEAR CLI` is built for:
- NEAR `dApp developers`, who build smart-contracts, UIs, and tooling on NEAR.
- `Tech-savvy` people automating their routines.
- `Validators`

`NEAR CLI UX principles`
- All altering actions should have a confirmation step with an option to skip confirmation with an explicit command line parameter (e.g. `send` at the end of the command)
- All direct children commands of a single parent command should be aligned (either represent an action or a resource, but never a mix of those on the same hierarchy level): `contract` -> `state` (resource) and `contract` -> `deploy` (action) are not aligned, so it should be either `contract` -> `get-state` + `contract` -> `deploy` or `contract` -> `state` -> `view` + `contract` -> `code` -> `deploy`
BenKurrek marked this conversation as resolved.
Show resolved Hide resolved
- Interactive mode should look like: `command - description`. It will help people to learn the commands.


## `Core NEAR CLI` commands
```txt
import-account
- from-near-wallet
- from-seed-phrase <seed-phrase>
- from-ledger
- from-private-key <private-key>

create-account
- implicit
- subaccount <master-account> <new-subaccount-id>
frol marked this conversation as resolved.
Show resolved Hide resolved

manage-account <accoundId>
frol marked this conversation as resolved.
Show resolved Hide resolved
- get-state
- manage-keys
- view
- add
- delete <public-key>
- make-transfer <sender> <reciever> <amount>
- manage-contract
- deploy-code <wasm-path>
- get-code-checksum
- get-state
frol marked this conversation as resolved.
Show resolved Hide resolved
- call-view-method
- call-change-method
- delete

manage-off-chain-keys
- ...
- generate-key
- get-public-key-from-ledger

manage-connections
frol marked this conversation as resolved.
Show resolved Hide resolved
- show-current
- set-current <connection-name>
- list-all
- add <connection-name> <network-name> <url1> <url1>
- delete <connection-name>

manage-cli-config
- set <parameter> <value>
- get <parameter>
```

## Extensions
volovyks marked this conversation as resolved.
Show resolved Hide resolved
Extensions design is a work in progress. They are here mostly to show that we haven't forgotten about particular functionality and that this functionality will not be a part of `Core NEAR CLI`.
frol marked this conversation as resolved.
Show resolved Hide resolved

### `developer` extension
```txt
- dev-deploy-code <wasm-file>
- ...
```

### `explorer` extension
```txt
- get-recent-block-hash
- get-transaction-status <transaction-hash>
- get-epoch-status <epoch>
- ...
```

### `transaction-constructor` extension
```txt
- constract-transaction
- sign-transaction-with-private-key
- combine-unsigned-transaction-with-signature
- sign-transaction-with-ledger
- send-signed-transaction
- deserialize-bytes-from-base64
- ...
```

### `staking-for-delegators` extension
```txt
- make-new-stake-proposal
- stake
- unstake
- ...
```

### `validators` extension
```txt
- validators
- proposals
- ...
```

## Open questions
- Where to add flags like `--verbose`, `--structured/json/csv`, `--scripting-mode`, etc.
volovyks marked this conversation as resolved.
Show resolved Hide resolved
- How to manage multiple keys? Should we have `default` key? Should they have a name like `mario-game-key-1`?
volovyks marked this conversation as resolved.
Show resolved Hide resolved
- Should we have `extensions` -> `list`/`add`/`delete` commands? We can do it in Phase 2.
volovyks marked this conversation as resolved.
Show resolved Hide resolved

## Other
- Let's get inspiration for keys and storage data from this project: https://github.com/near-examples/near-account-utils
volovyks marked this conversation as resolved.
Show resolved Hide resolved