Skip to content

Commit f8b73ea

Browse files
Copilotfrol
andauthored
doc: Improve clarity and consistency of interactive prompts (#538)
Interactive prompts throughout the CLI contained inconsistencies in grammar, formatting, and terminology that could confuse users unfamiliar with NEAR. ## Changes ### Grammar and style - Fixed contractions: "I dont know" → "I don't know" - Standardized conditional phrases: "if you not sure" → "if you're not sure" - Unified action verbs: "input" → "enter" ### Token amount formatting Standardized NEAR token examples across all prompts: ```diff - (example: 10NEAR or 0.5near or 10000yoctonear) + (example: 10 NEAR or 0.5 NEAR or 10000 yoctonear) ``` ### Technical terminology - Capitalized properly: "url" → "URL", "fastnear" → "FastNEAR", "coingecko" → "CoinGecko" - Added context: "MPC contract" → "MPC (Multi-Party Computation) contract" ### File path prompts Unified disparate phrasings to consistent format: ```diff - "What is the location of the file to save..." - "Where to save the implicit account file?" - "Enter the name of the file to save..." + "Enter the file path where to save..." ``` ### Simplified verbose prompts ```diff - "You chose to limit the access key to only sign transactions for a specific contract. Enter the contract account ID:" + "Enter the contract account ID that this access key is limited to:" ``` **Files affected:** 27 files across account management, staking, transactions, contract operations, and signature handling. <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Review texts used in interactive mode</issue_title> > <issue_description>There are lots of interactive steps that ask some questions and suggest options like: > > !<span class="error">[image]</span>([https://user-images.githubusercontent.com/304265/120762439-a2f19780-c4ec-11eb-8440-0ad68e5f171b.png](https://user-images.githubusercontent.com/304265/120762439-a2f19780-c4ec-11eb-8440-0ad68e5f171b.png)) > > We should thoroughly review those to make sure they are clear and aligned. > > If you are not familiar with NEAR, it is even better! Try this near-cli and report back whenever you stuck and unable to understand what is going on.</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #15 <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/near/near-cli-rs/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: Vlad Frolov <[email protected]>
1 parent 86d04ca commit f8b73ea

File tree

27 files changed

+78
-74
lines changed

27 files changed

+78
-74
lines changed

src/commands/account/add_key/access_key_type/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub struct FunctionCallType {
5555
#[interactive_clap(skip_default_input_arg)]
5656
allowance: crate::types::near_allowance::NearAllowance,
5757
#[interactive_clap(long)]
58-
/// You chose to limit the access key to only sign transactions for a specific contract. Enter the contract account ID:
58+
/// Enter the contract account ID that this access key can be used to sign call function transactions for:
5959
contract_account_id: crate::types::account_id::AccountId,
6060
#[interactive_clap(long)]
6161
#[interactive_clap(skip_default_input_arg)]
@@ -145,7 +145,7 @@ impl FunctionCallType {
145145
_context: &super::AddKeyCommandContext,
146146
) -> color_eyre::eyre::Result<Option<crate::types::near_allowance::NearAllowance>> {
147147
let allowance_near_balance: crate::types::near_allowance::NearAllowance =
148-
CustomType::new("Enter the allowance, a budget this access key can use to pay for transaction fees (example: 10NEAR or 0.5near or 10000yoctonear):")
148+
CustomType::new("Enter the allowance, a budget this access key can use to pay for transaction fees (example: 10 NEAR or 0.5 NEAR or 10000 yoctonear):")
149149
.with_starting_input("unlimited")
150150
.prompt()?;
151151
Ok(Some(allowance_near_balance))

src/commands/account/create_account/create_implicit_account/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub enum Mode {
4141
#[interactive_clap(output_context = SaveToFolderContext)]
4242
pub struct SaveToFolder {
4343
#[interactive_clap(skip_default_input_arg)]
44-
/// Where to save the implicit account file?
44+
/// Enter the file path where to save the implicit account:
4545
folder_path: crate::types::path_buf::PathBuf,
4646
}
4747

@@ -65,7 +65,7 @@ impl SaveToFolder {
6565
context: &SaveImplicitAccountContext,
6666
) -> color_eyre::eyre::Result<Option<crate::types::path_buf::PathBuf>> {
6767
Ok(Some(
68-
CustomType::new("Where to save the implicit account file?")
68+
CustomType::new("Enter the file path where to save the implicit account:")
6969
.with_starting_input(&format!(
7070
"{}/implicit",
7171
context.config.credentials_home_dir.to_string_lossy()

src/commands/account/create_account/fund_myself_create_account/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl NewAccount {
132132
_context: &crate::GlobalContext,
133133
) -> color_eyre::eyre::Result<Option<crate::types::near_token::NearToken>> {
134134
Ok(Some(
135-
CustomType::new("Enter the amount of the NEAR tokens you want to fund the new account with (example: 10NEAR or 0.5near or 10000yoctonear):")
135+
CustomType::new("Enter the amount of NEAR tokens you want to fund the new account with (example: 10 NEAR or 0.5 NEAR or 10000 yoctonear):")
136136
.with_starting_input("0.1 NEAR")
137137
.prompt()?
138138
))

src/commands/account/storage_management/storage_deposit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub struct DepositArgs {
77
#[interactive_clap(skip_default_input_arg)]
88
/// Which account ID do you want to add a deposit to?
99
receiver_account_id: crate::types::account_id::AccountId,
10-
/// Enter the amount to deposit into the storage (example: 10NEAR or 0.5near or 10000yoctonear):
10+
/// Enter the amount to deposit into the storage (example: 10 NEAR or 0.5 NEAR or 10000 yoctonear):
1111
deposit: crate::types::near_token::NearToken,
1212
#[interactive_clap(named_arg)]
1313
/// What is the signer account ID?

src/commands/account/storage_management/storage_withdraw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#[interactive_clap(input_context = super::ContractContext)]
33
#[interactive_clap(output_context = WithdrawArgsContext)]
44
pub struct WithdrawArgs {
5-
/// Enter the amount to withdraw from the storage (example: 10NEAR or 0.5near or 10000yoctonear):
5+
/// Enter the amount to withdraw from the storage (example: 10 NEAR or 0.5 NEAR or 10000 yoctonear):
66
amount: crate::types::near_token::NearToken,
77
#[interactive_clap(named_arg)]
88
/// What is the signer account ID?

src/commands/account/update_social_profile/profile_args_type/manually.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl Manually {
400400
.prompt()?;
401401
if let ConfirmOptions::Yes = select_choose_input {
402402
let tags: crate::types::vec_string::VecString =
403-
CustomType::new("Enter a comma-separated list of tags for account profile:")
403+
CustomType::new("Enter a comma-separated list of tags for the account profile:")
404404
.prompt()?;
405405
Ok(Some(tags))
406406
} else {

src/commands/config/add_connection/mod.rs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@ impl AddNetworkConnection {
116116
) -> color_eyre::eyre::Result<Option<crate::types::api_key::ApiKey>> {
117117
#[derive(strum_macros::Display)]
118118
enum ConfirmOptions {
119-
#[strum(to_string = "Yes, the RPC endpoint requires API key")]
119+
#[strum(to_string = "Yes, the RPC endpoint requires an API key")]
120120
Yes,
121-
#[strum(to_string = "No, the RPC endpoint does not require API key")]
121+
#[strum(to_string = "No, the RPC endpoint does not require an API key")]
122122
No,
123123
}
124124
let select_choose_input = Select::new(
125-
"Do you want to input an API key?",
125+
"Do you want to enter an API key?",
126126
vec![ConfirmOptions::Yes, ConfirmOptions::No],
127127
)
128128
.prompt()?;
129129
if let ConfirmOptions::Yes = select_choose_input {
130130
let api_key: crate::types::api_key::ApiKey =
131-
CustomType::new("Enter an API key").prompt()?;
131+
CustomType::new("Enter an API key:").prompt()?;
132132
Ok(Some(api_key))
133133
} else {
134134
Ok(None)
@@ -144,7 +144,7 @@ impl AddNetworkConnection {
144144
to_string = "Yes, and I want to enter the name of the account hosting the program \"linkdrop\""
145145
)]
146146
Yes,
147-
#[strum(to_string = "I dont know")]
147+
#[strum(to_string = "I don't know")]
148148
No,
149149
}
150150
let select_choose_input = Select::new(
@@ -154,7 +154,7 @@ impl AddNetworkConnection {
154154
.prompt()?;
155155
if let ConfirmOptions::Yes = select_choose_input {
156156
let account_id: crate::types::account_id::AccountId =
157-
CustomType::new("What is the name of the account that hosts the \"linkdrop\" program? (e.g. on mainnet it is near, and on testnet it is testnet)").prompt()?;
157+
CustomType::new("What is the name of the account that hosts the linkdrop program? (e.g. on mainnet it is 'near', on testnet it is 'testnet')").prompt()?;
158158
Ok(Some(account_id))
159159
} else {
160160
Ok(None)
@@ -180,7 +180,7 @@ impl AddNetworkConnection {
180180
.prompt()?;
181181
if let ConfirmOptions::Yes = select_choose_input {
182182
let account_id: crate::types::account_id::AccountId =
183-
CustomType::new("What is the name of the NEAR Social DB contract account ID (e.g. on mainnet it is social.near)").prompt()?;
183+
CustomType::new("What is the NEAR Social DB contract account ID? (e.g. on mainnet it is 'social.near')").prompt()?;
184184
Ok(Some(account_id))
185185
} else {
186186
Ok(None)
@@ -204,7 +204,7 @@ impl AddNetworkConnection {
204204
.prompt()?;
205205
if let ConfirmOptions::Yes = select_choose_input {
206206
let faucet_url: crate::types::url::Url =
207-
CustomType::new("What is the faucet url?").prompt()?;
207+
CustomType::new("What is the faucet URL?").prompt()?;
208208
Ok(Some(faucet_url))
209209
} else {
210210
Ok(None)
@@ -228,7 +228,7 @@ impl AddNetworkConnection {
228228
.prompt()?;
229229
if let ConfirmOptions::Yes = select_choose_input {
230230
let meta_transaction_relayer_url: crate::types::url::Url =
231-
CustomType::new("What is the relayer url?").prompt()?;
231+
CustomType::new("What is the meta transaction relayer URL?").prompt()?;
232232
Ok(Some(meta_transaction_relayer_url))
233233
} else {
234234
Ok(None)
@@ -240,19 +240,19 @@ impl AddNetworkConnection {
240240
) -> color_eyre::eyre::Result<Option<crate::types::url::Url>> {
241241
#[derive(strum_macros::Display)]
242242
enum ConfirmOptions {
243-
#[strum(to_string = "Yes, I want to enter the fastnear API url")]
243+
#[strum(to_string = "Yes, I want to enter the FastNEAR API URL")]
244244
Yes,
245-
#[strum(to_string = "No, I don't want to enter the fastnear API url")]
245+
#[strum(to_string = "No, I don't want to enter the FastNEAR API URL")]
246246
No,
247247
}
248248
let select_choose_input = Select::new(
249-
"Do you want to enter the fastnear API url?",
249+
"Do you want to enter the FastNEAR API URL?",
250250
vec![ConfirmOptions::Yes, ConfirmOptions::No],
251251
)
252252
.prompt()?;
253253
if let ConfirmOptions::Yes = select_choose_input {
254254
let stake_delegators_api: crate::types::url::Url =
255-
CustomType::new("What is the fastnear API url?").prompt()?;
255+
CustomType::new("What is the FastNEAR API URL?").prompt()?;
256256
Ok(Some(stake_delegators_api))
257257
} else {
258258
Ok(None)
@@ -288,19 +288,19 @@ impl AddNetworkConnection {
288288
) -> color_eyre::eyre::Result<Option<crate::types::url::Url>> {
289289
#[derive(strum_macros::Display)]
290290
enum ConfirmOptions {
291-
#[strum(to_string = "Yes, I want to enter the coingecko API url")]
291+
#[strum(to_string = "Yes, I want to enter the CoinGecko API URL")]
292292
Yes,
293-
#[strum(to_string = "No, I don't want to enter the coingecko API url")]
293+
#[strum(to_string = "No, I don't want to enter the CoinGecko API URL")]
294294
No,
295295
}
296296
let select_choose_input = Select::new(
297-
"Do you want to enter the coingecko API url?",
297+
"Do you want to enter the CoinGecko API URL?",
298298
vec![ConfirmOptions::Yes, ConfirmOptions::No],
299299
)
300300
.prompt()?;
301301
if let ConfirmOptions::Yes = select_choose_input {
302302
let coingecko_api: crate::types::url::Url =
303-
CustomType::new("What is the coingecko API url?")
303+
CustomType::new("What is the CoinGecko API URL?")
304304
.with_starting_input("https://api.coingecko.com/")
305305
.prompt()?;
306306
Ok(Some(coingecko_api))
@@ -326,7 +326,8 @@ impl AddNetworkConnection {
326326
.prompt()?;
327327
if let ConfirmOptions::Yes = select_choose_input {
328328
let mpc_contract_account_id: crate::types::account_id::AccountId =
329-
CustomType::new("What is the MPC contract account ID?").prompt()?;
329+
CustomType::new("What is the MPC (Multi-Party Computation) contract account ID?")
330+
.prompt()?;
330331
Ok(Some(mpc_contract_account_id))
331332
} else {
332333
Ok(None)

src/commands/contract/download_abi/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub struct Contract {
1111
/// What is the contract account ID?
1212
account_id: crate::types::account_id::AccountId,
1313
#[interactive_clap(named_arg)]
14-
/// Enter the name of the file to save the contract ABI:
14+
/// Enter the file path where to save the contract ABI:
1515
save_to_file: DownloadContractAbi,
1616
}
1717

@@ -49,7 +49,7 @@ impl Contract {
4949
#[interactive_clap(output_context = DownloadContractContext)]
5050
pub struct DownloadContractAbi {
5151
#[interactive_clap(skip_default_input_arg)]
52-
/// Enter the name of the file to save the contract ABI:
52+
/// Enter the file path where to save the contract ABI:
5353
file_path: crate::types::path_buf::PathBuf,
5454
#[interactive_clap(named_arg)]
5555
/// Select network

src/commands/contract/download_wasm/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub struct ArgsForDownloadContract {
6464
#[interactive_clap(output_context = DownloadContractContext)]
6565
pub struct DownloadContract {
6666
#[interactive_clap(skip_default_input_arg)]
67-
/// Enter the name of the file to save the contract:
67+
/// Enter the file path where to save the contract:
6868
file_path: crate::types::path_buf::PathBuf,
6969
#[interactive_clap(named_arg)]
7070
/// Select network
@@ -76,7 +76,7 @@ impl DownloadContract {
7676
_context: &ArgsForDownloadContract,
7777
) -> color_eyre::eyre::Result<Option<crate::types::path_buf::PathBuf>> {
7878
Ok(Some(
79-
CustomType::new("Enter the name of the file to save the contract:")
79+
CustomType::new("Enter the file path where to save the contract:")
8080
.with_starting_input("contract.wasm")
8181
.prompt()?,
8282
))

src/commands/staking/delegate/deposit_and_stake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#[interactive_clap(input_context = super::StakeDelegationContext)]
33
#[interactive_clap(output_context = DepositAndStakeContext)]
44
pub struct DepositAndStake {
5-
/// Enter the attached amount to be deposited and then staked into the predecessor's internal account (example: 10NEAR or 0.5near or 10000yoctonear):
5+
/// Enter the attached amount to be deposited and then staked into the predecessor's internal account (example: 10 NEAR or 0.5 NEAR or 10000 yoctonear):
66
amount: crate::types::near_token::NearToken,
77
#[interactive_clap(skip_default_input_arg)]
88
/// What is validator account ID?

0 commit comments

Comments
 (0)