From a16558ed05428661936c317c0da15bd07eeaaba1 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Sat, 4 Mar 2023 16:48:20 -0800 Subject: cli: ATP_PDS_HOST as env var --- CHANGELOG.md | 4 ++++ adenosine-cli/README.md | 8 +++---- adenosine-cli/plan.txt | 2 +- adenosine-cli/src/bin/adenosine.rs | 10 ++++---- extra/adenosine.1 | 30 ++++++++++++------------ extra/adenosine.1.md | 48 ++++++++++++++------------------------ extra/adenosine.1.scdoc | 8 +++---- 7 files changed, 51 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ea0924..7663596 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,10 @@ helpers, and probably client code and generated Lexicon code there. upstream behavior) - ipld conversion: fix 'car' vs. 'cid' typo in special-case handling +## Changed + +- cli: `ATP_PDS_HOST` instead of `ATP_HOST` + ## [0.2.0] - 2022-12-19 Tracking upstream Lexicon changes. Not backwards-compatible at the CLI/PDS XRPC diff --git a/adenosine-cli/README.md b/adenosine-cli/README.md index c66479d..e5a3cce 100644 --- a/adenosine-cli/README.md +++ b/adenosine-cli/README.md @@ -63,15 +63,15 @@ official official [`bluesky-social/atproto`](https://github.com/bluesky-social/a prototype (see [local atproto dev quickstart](./../notes/atproto_quickstart.md)). -Set the `ATP_HOST` environment variable. Then either register a test account, +Set the `ATP_PDS_HOST` environment variable. Then either register a test account, or create a new session for an existing account, and save the JWT token to the `ATP_AUTH_TOKEN`: # default port for bluesky-social/atproto implementation - export ATP_HOST=http://localhost:2583 + export ATP_PDS_HOST=http://localhost:2583 # default port for adenosine-pds implementation - export ATP_HOST=http://localhost:3030 + export ATP_PDS_HOST=http://localhost:3030 # register a new account adenosine account register -u voltaire.test -p bogus -e voltaire@example.com @@ -96,7 +96,7 @@ or create a new session for an existing account, and save the JWT token to the export ATP_AUTH_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6cGxjOnlxdHVrc3ZhdG1tZ25nZDVua2t3NzVobiIsImlhdCI6MTY2Njk5NjQxNX0.j2wcF1g9NxT_1AvYRiplNf_jtK6S81y3L38AkcBwOqY -You could save the `ATP_HOST` and `ATP_AUTH_TOKEN` values in `~/.bashrc` so you +You could save the `ATP_PDS_HOST` and `ATP_AUTH_TOKEN` values in `~/.bashrc` so you don't need to enter them every time. Now you can start posting and poking around: diff --git a/adenosine-cli/plan.txt b/adenosine-cli/plan.txt index 32e5070..f7f65fe 100644 --- a/adenosine-cli/plan.txt +++ b/adenosine-cli/plan.txt @@ -6,7 +6,7 @@ just talks to the remote. config variables: - ATP_HOST: prefix, eg http://localhost:1234 + ATP_PDS_HOST: prefix, eg http://localhost:1234 ATP_AUTH_TOKEN: JWT string at-uri can be either a global `at://` URI string, or a user-local referene of diff --git a/adenosine-cli/src/bin/adenosine.rs b/adenosine-cli/src/bin/adenosine.rs index ae03a2c..b031353 100644 --- a/adenosine-cli/src/bin/adenosine.rs +++ b/adenosine-cli/src/bin/adenosine.rs @@ -24,11 +24,11 @@ struct Opt { /// HTTP(S) URL of Personal Data Server to connect to #[structopt( global = true, - long = "--host", - env = "ATP_HOST", + long = "--pds-host", + env = "ATP_PDS_HOST", default_value = "http://localhost:2583" )] - atp_host: String, + pds_host: String, /// Authentication session token (JWT), for operations that need it #[structopt( @@ -333,7 +333,7 @@ fn require_auth_did(opt: &Opt, xrpc_client: &mut XrpcClient) -> Result { fn run(opt: Opt) -> Result<()> { let mut xrpc_client = XrpcClient::new( - opt.atp_host.clone(), + opt.pds_host.clone(), opt.auth_token.clone(), opt.admin_password.clone(), )?; @@ -347,7 +347,7 @@ fn run(opt: Opt) -> Result<()> { let result = match opt.cmd { Command::Status => { println!("Configuration"); - println!(" ATP_HOST: {}", opt.atp_host); + println!(" ATP_PDS_HOST: {}", opt.pds_host); if opt.auth_token.is_some() { println!(" ATP_AUTH_TOKEN: "); } else { diff --git a/extra/adenosine.1 b/extra/adenosine.1 index 24ebdb2..060977e 100644 --- a/extra/adenosine.1 +++ b/extra/adenosine.1 @@ -1,11 +1,11 @@ -.\" Generated by scdoc 1.11.1 +.\" Generated by scdoc 1.11.2 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: -.TH "adenosine" "1" "2022-11-07" "adenosine CLI Client Manual Page" +.TH "adenosine" "1" "2023-03-05" "adenosine CLI Client Manual Page" .P .SH NAME .P @@ -34,7 +34,7 @@ Lexicon (bsky.\&app) is partially supported with helper commands.\& .P Several commands accept generic key/value fields which are passed through as either query parameters or combined together in to a request body JSON object.\& -Escaping and other corner-cases aren't handled.\& +Escaping and other corner-cases aren'\&t handled.\& .P \fB==\fR .RS 4 @@ -46,7 +46,7 @@ Query parameter.\& Key and Value both passed as strings.\& Body fields, combined together as a JSON object.\& Keys are strings, values are parsed as JSON with fall-through to string type.\& .P .RE -For example, the argument list \fBlimit==25 title="regarding documentation" year=2022 tags='["blue", "green"]'\fR +For example, the argument list \fBlimit==25 title="regarding documentation" year=2022 tags='\&["blue", "green"]'\&\fR would be interpreted as a single query parameter "limit" with value "25", and a JSON object with keys "title" (string value), "year" (number value), "tags" (array of strings).\& @@ -112,12 +112,12 @@ Fetch the home feed, or account feed for a specific user .RE \fBbsky follow\fR .RS 4 -Create a 'follow' record for the target by AT URI +Create a '\&follow'\& record for the target by AT URI .P .RE \fBbsky like\fR .RS 4 -Create a 'like' record for the target by AT URI +Create a '\&like'\& record for the target by AT URI .P .RE \fBbsky notifications\fR @@ -127,7 +127,7 @@ Fetch notification feed .RE \fBbsky post\fR .RS 4 -Create a new 'post' record +Create a new '\&post'\& record .P .RE \fBbsky profile\fR @@ -137,7 +137,7 @@ Display a profile record (or self if not provided) .RE \fBbsky repost\fR .RS 4 -Create a 'repost' record for the target by AT URI +Create a '\&repost'\& record for the target by AT URI .P .RE \fBbsky search-users\fR @@ -179,7 +179,7 @@ Read raw binary repository as CAR format from stdin, and import to PDS .RE \fBrepo root [did]\fR .RS 4 -Get the current 'root' commit for a DID +Get the current '\&root'\& commit for a DID .P .RE .SH OPTIONS @@ -197,23 +197,23 @@ Prints version information \fB-v, --verbose\fR .RS 4 Pass many times for more log output -By default, it'll only report errors.\& Passing `-v` one time also prints warnings, `-vv` enables info logging, `-vvv` debug, and `-vvvv` trace.\& +By default, it'\&ll only report errors.\& Passing `-v` one time also prints warnings, `-vv` enables info logging, `-vvv` debug, and `-vvvv` trace.\& .P .RE -\fB--host \fR [env: ATP_HOST] +\fB--pds-host \fR [env: ATP_PDS_HOST] .P \fB--auth-token \fR [env: ATP_AUTH_TOKEN] .P .SH GETTING STARTED .P -To start interacting with a PDS, set the `ATP_HOST` environment variable.\& Then +To start interacting with a PDS, set the `ATP_PDS_HOST` environment variable.\& Then either register a test account, or create a new session for an existing account, and save the JWT token to the `ATP_AUTH_TOKEN`: .P .nf .RS 4 # default port for bluesky-social/atproto implementation -export ATP_HOST=http://localhost:2583 +export ATP_PDS_HOST=http://localhost:2583 # register a new account adenosine account register -u voltaire\&.test -p bogus -e voltaire@example\&.com @@ -240,8 +240,8 @@ export ATP_AUTH_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9\&.eyJzdWIiOiJkaWQ6cGx .fi .RE .P -You could save the `ATP_HOST` and `ATP_AUTH_TOKEN` values in `~/.\&bashrc` so you -don't need to enter them every time.\& +You could save the `ATP_PDS_HOST` and `ATP_AUTH_TOKEN` values in `~/.\&bashrc` so you +don'\&t need to enter them every time.\& .P Now you can start posting and poking around: .P diff --git a/extra/adenosine.1.md b/extra/adenosine.1.md index 424312d..a724f3c 100644 --- a/extra/adenosine.1.md +++ b/extra/adenosine.1.md @@ -1,15 +1,12 @@ -NAME -==== +# NAME adenosine - command-line client for AT protocol (atproto.com) -SYNOPSIS -======== +# SYNOPSIS adenosine \[OPTIONS\] \ \ -DESCRIPTION -=========== +# DESCRIPTION This is a simple, enthusiast-grade CLI client for the work-in-progress AT Protocol (atproto.com). It is an entirely \"delegated\" client, which @@ -25,8 +22,7 @@ either at compile time or runtime (eg, dynamically fetching Lexicons). The Bluesky Lexicon (bsky.app) is partially supported with helper commands. -FIELD SYNTAX -============ +# FIELD SYNTAX Several commands accept generic key/value fields which are passed through as either query parameters or combined together in to a request @@ -47,8 +43,7 @@ interpreted as a single query parameter \"limit\" with value \"25\", and a JSON object with keys \"title\" (string value), \"year\" (number value), \"tags\" (array of strings). -COMMANDS -======== +# COMMANDS **status** @@ -63,8 +58,7 @@ COMMANDS > Has PDS resolve handle to a DID -Generic XRPC Requests ---------------------- +## Generic XRPC Requests It is possible to construct and submit a generic XRPC request to the PDS, and prints any response.See field syntax section above about query @@ -72,8 +66,7 @@ parameters and body fields. Body fields only used for \"post\" requests. **xrpc** \<\"get\"\|\"post\"\> \ \[fields\]+ -Generic Record Interaction --------------------------- +## Generic Record Interaction **ls** \ @@ -97,8 +90,7 @@ Generic Record Interaction > Delete a single record from repository -Bluesky (bsky.app) ------------------- +## Bluesky (bsky.app) **bsky feed** @@ -132,8 +124,7 @@ Bluesky (bsky.app) > Query by partial handle -Account Management ------------------- +## Account Management **account register \--email \ \--password \ \--handle \** @@ -150,8 +141,7 @@ Account Management > Deletes the current login session -Raw Repository Management -------------------------- +## Raw Repository Management **repo export \[did\]** @@ -165,8 +155,7 @@ Raw Repository Management > Get the current \'root\' commit for a DID -OPTIONS -======= +# OPTIONS **-h, \--help** @@ -182,20 +171,19 @@ OPTIONS > errors. Passing \`-v\` one time also prints warnings, \`-vv\` enables > info logging, \`-vvv\` debug, and \`-vvvv\` trace. -**\--host \** \[env: ATP\_HOST\] +**\--pds-host \** \[env: ATP_PDS_HOST\] -**\--auth-token \** \[env: ATP\_AUTH\_TOKEN\] +**\--auth-token \** \[env: ATP_AUTH_TOKEN\] -GETTING STARTED -=============== +# GETTING STARTED -To start interacting with a PDS, set the \`ATP\_HOST\` environment +To start interacting with a PDS, set the \`ATP_PDS_HOST\` environment variable. Then either register a test account, or create a new session for an existing account, and save the JWT token to the -\`ATP\_AUTH\_TOKEN\`: +\`ATP_AUTH_TOKEN\`: # default port for bluesky-social/atproto implementation - export ATP_HOST=http://localhost:2583 + export ATP_PDS_HOST=http://localhost:2583 # register a new account adenosine account register -u voltaire.test -p bogus -e voltaire@example.com @@ -220,7 +208,7 @@ for an existing account, and save the JWT token to the export ATP_AUTH_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6cGxjOnlxdHVrc3ZhdG1tZ25nZDVua2t3NzVobiIsImlhdCI6MTY2Njk5NjQxNX0.j2wcF1g9NxT_1AvYRiplNf_jtK6S81y3L38AkcBwOqY -You could save the \`ATP\_HOST\` and \`ATP\_AUTH\_TOKEN\` values in +You could save the \`ATP_PDS_HOST\` and \`ATP_AUTH_TOKEN\` values in \`\~/.bashrc\` so you don\'t need to enter them every time. Now you can start posting and poking around: diff --git a/extra/adenosine.1.scdoc b/extra/adenosine.1.scdoc index 41d7413..e6e63ef 100644 --- a/extra/adenosine.1.scdoc +++ b/extra/adenosine.1.scdoc @@ -139,19 +139,19 @@ body fields. Body fields only used for "post" requests. Pass many times for more log output By default, it'll only report errors. Passing `-v` one time also prints warnings, `-vv` enables info logging, `-vvv` debug, and `-vvvv` trace. -*--host * [env: ATP_HOST] +*--pds-host * [env: ATP_PDS_HOST] *--auth-token * [env: ATP_AUTH_TOKEN] # GETTING STARTED -To start interacting with a PDS, set the `ATP_HOST` environment variable. Then +To start interacting with a PDS, set the `ATP_PDS_HOST` environment variable. Then either register a test account, or create a new session for an existing account, and save the JWT token to the `ATP_AUTH_TOKEN`: ``` # default port for bluesky-social/atproto implementation -export ATP_HOST=http://localhost:2583 +export ATP_PDS_HOST=http://localhost:2583 # register a new account adenosine account register -u voltaire.test -p bogus -e voltaire@example.com @@ -177,7 +177,7 @@ adenosine account login -u voltaire.test -p bogus export ATP_AUTH_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6cGxjOnlxdHVrc3ZhdG1tZ25nZDVua2t3NzVobiIsImlhdCI6MTY2Njk5NjQxNX0.j2wcF1g9NxT_1AvYRiplNf_jtK6S81y3L38AkcBwOqY ``` -You could save the `ATP_HOST` and `ATP_AUTH_TOKEN` values in `~/.bashrc` so you +You could save the `ATP_PDS_HOST` and `ATP_AUTH_TOKEN` values in `~/.bashrc` so you don't need to enter them every time. Now you can start posting and poking around: -- cgit v1.2.3