Add oc session ls|rm, PowerShell login docs, Windows test fix - #62
Merged
Merged
Conversation
… removed `oc login --session work` writes a jar and no page, and `session ls` only enumerated pages, so an agent auditing leftover logins was told there were none while a live credential sat on disk. ls now lists a name when it has a page, a jar, or both, and marks jars with `[cookies]` (a `cookies` field in `--json`), since without that an agent told to drop logged-in sessions cannot tell which to rm. clearSession and clearCookieJar swallowed every unlink error, so `session rm` printed "forgot session" and exited 0 on a read-only directory, a directory named like a page, or a typo. Both now ignore only ENOENT and report whether they removed anything; rm fails with "no such session" when neither did. logout keeps its silent exit 0. Both commands share one forgetSession helper, so the next per-session artifact cannot be forgotten by one and not the other. A name ending in `.cookies` saved its page at the path of the shorter name's jar, so `rm x` deleted session `x.cookies` and ls hid it: assertSafeName now rejects the suffix. ls also uses the same name check as rm (so `..json` and directories no longer list as sessions rm cannot remove), and the sidecar suffix is one exported constant shared with cookies.js. Copy edits to the new README, SKILL, and CHANGELOG prose; the CHANGELOG now says only the CLI tests run on Windows, since the cookie file-mode test still fails there.
only-cli
force-pushed
the
gena/session-ls-rm
branch
from
September 16, 2026 03:13
60ba9e7 to
b990662
Compare
Owner
|
Thanks for this PR, @Chagas74! I reviewed it and pushed one follow-up commit (b990662) onto your branch rather than round-tripping, since the fixes were mechanical. Please glance over it and shout if anything looks off:
Tests added for each of the above; the full suite passes locally. |
oc session ls|rm, and reddit.com read through its feeds; see CHANGELOG.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the planned \session ls|rm\ commands and two doc gaps found while adapting oc for a Windows agent setup.
Added
o saved sessions\ when empty)
Docs
Fixed
Validation