Skip to content

docs: Restish cli guide - #450

Draft
GabriellePoncey wants to merge 2 commits into
mainfrom
docs/PLAT-671/restish-cli-guide
Draft

docs: Restish cli guide#450
GabriellePoncey wants to merge 2 commits into
mainfrom
docs/PLAT-671/restish-cli-guide

Conversation

@GabriellePoncey

Copy link
Copy Markdown
Contributor

Summary

Adds a guide for using restish as a cli tool. Document a quickstart process (rapid installation and experimentation), profile management, project configuration and mtls profile setup, database config files and secrets.

PLAT-671

Adds a guide for using restish as a cli tool. Document a quickstart process (rapid installation and experimentation), profile management, project configuration and mtls profile setup, database config files and secrets.

PLAT-671
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Restish CLI documentation is added. It covers installation, profiles, project configuration, TLS settings, database configuration files, and secret handling. The new guide is linked under the API navigation.

Changes

Restish CLI documentation

Layer / File(s) Summary
Guide entry and quickstart
docs/api/restish.md, mkdocs.yml
Adds the guide outline, installation and connection instructions, generated command examples, and an API navigation entry.
Profiles and connection configuration
docs/api/restish.md
Documents profiles, .restish.json, trusted configuration, host-specific settings, TLS certificates, private CAs, OpenAPI specifications, and connection commands.
Database files and secret handling
docs/api/restish.md
Documents database JSON files, create and update commands, profile targeting, and temporary handling of credentials and backup secrets.

Poem

I’m a rabbit with Restish in tow,
Through profiles and databases I go.
Secrets stay away,
From commits every day—
Hop through the API flow!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main documentation scope and references PLAT-671, but it omits the required Changes, Testing, Checklist, and Notes sections. Add the required Changes, Testing, Checklist, and Notes sections, and record testing steps and checklist status.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the documentation change for the Restish CLI guide and follows the repository's docs convention.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/PLAT-671/restish-cli-guide

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/api/restish.md`:
- Around line 187-210: Update the example configuration in the REST API guide so
the canonical databases/example.json contains no real password or other secrets.
Demonstrate the initial create request using a separate create-only secrets
file, and ensure the documented ignore/commit workflow keeps that file out of
version control without claiming the committed configuration is always safe
after containing secrets.
- Around line 164-170: Update the private-CA connection example in the RESTish
documentation to include the --rsh-ca-cert option alongside --spec, showing how
to provide the custom CA certificate while preserving the explicit OpenAPI URL
example.
- Around line 154-162: Update the follow-up Restish command examples in the
personal-connection section to use the registered API name pgedge-sandbox
instead of pgedge. Keep shared-API examples unchanged, and ensure commands for
inspecting or deleting the personal API target pgedge-sandbox consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 924a4e99-8725-4105-9cce-5b5ecd489211

📥 Commits

Reviewing files that changed from the base of the PR and between 12fdcd5 and 92dabb6.

📒 Files selected for processing (2)
  • docs/api/restish.md
  • mkdocs.yml

Comment thread docs/api/restish.md
Comment thread docs/api/restish.md Outdated
Comment thread docs/api/restish.md
Addresses review findings against the guide added in 92dabb6:

- Stop putting a real password in the committed
  databases/example.json example. The initial create-database call
  now sources secrets from a separate, deleted-after-use file, and
  the "Handling Secrets" section describes that actual workflow
  instead of claiming a file that once held a credential is safe
  after the fact.
- Add --rsh-ca-cert to the private-CA connection example; --spec
  alone only fixes discovery failures; it doesn't establish trust
  for a private CA.
- Make the personal-connection follow-up commands (api inspect,
  --help) consistently target pgedge-sandbox instead of mixing in
  the shared pgedge name.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/api/restish.md`:
- Around line 219-243: The example workflow should securely manage the temporary
JSON file containing the database password: set a restrictive umask, create the
file with mktemp, register an EXIT trap to remove it, write the payload to that
generated path, and pass that path to restish. Apply the same lifecycle changes
to the additional example referenced by the comment, and limit any cleanup claim
to the committed temporary file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3e22b3b0-e7b3-4b14-879b-aeddf1b1d156

📥 Commits

Reviewing files that changed from the base of the PR and between 92dabb6 and edb357e.

📒 Files selected for processing (1)
  • docs/api/restish.md

Comment thread docs/api/restish.md
Comment on lines +219 to +243
```sh
cat > /tmp/example.create.json <<'EOF'
{
"id": "example",
"spec": {
"database_name": "example",
"database_users": [
{
"username": "admin",
"password": "changeme",
"db_owner": true,
"attributes": ["SUPERUSER", "LOGIN"]
}
],
"port": 5432,
"nodes": [
{ "name": "n1", "host_ids": ["host-1"] },
{ "name": "n2", "host_ids": ["host-2"] },
{ "name": "n3", "host_ids": ["host-3"] }
]
}
}
EOF
restish pgedge create-database < /tmp/example.create.json
rm /tmp/example.create.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Create and remove the temporary secret file securely.

cat > /tmp/example.create.json uses a predictable path and does not set restrictive permissions. An interrupted shell can also leave the password in /tmp.

Use umask 077, mktemp, and an EXIT trap. Narrow the later claim to the committed file unless the temporary-file lifecycle is secured.

Proposed secure temporary-file workflow
+umask 077
+secret_file="$(mktemp "${TMPDIR:-/tmp}/example.create.XXXXXX")"
+trap 'rm -f -- "$secret_file"' EXIT
-cat > /tmp/example.create.json <<'EOF'
+cat > "$secret_file" <<'EOF'
...
-restish pgedge create-database < /tmp/example.create.json
-rm /tmp/example.create.json
+restish pgedge create-database < "$secret_file"

Also applies to: 278-289

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/api/restish.md` around lines 219 - 243, The example workflow should
securely manage the temporary JSON file containing the database password: set a
restrictive umask, create the file with mktemp, register an EXIT trap to remove
it, write the payload to that generated path, and pass that path to restish.
Apply the same lifecycle changes to the additional example referenced by the
comment, and limit any cleanup claim to the committed temporary file.

@GabriellePoncey
GabriellePoncey requested a review from mmols August 1, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant