Enables authentication in non-interactive environments (CI/CD, Trae
sandbox, MCP) by reading token from GITLINK_TOKEN environment variable.
Falls back to existing interactive login flow when env var is not set.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Commands like issue +create, pr +view, release +create were missing
--owner/--repo flags in examples, causing errors when run outside a
git repository directory.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Root cause: GitLink login API returns session cookies (autologin_trustie),
not API access_tokens. The old code tried to use the cookie value as an
access_token query parameter, which GitLink rejects.
Fix: store auth cookies with "cookie:" prefix. Transport detects the
prefix and sends credentials as Cookie header instead of access_token
param. Private tokens (from --token mode) continue to use access_token
param — fully backward compatible.
Verified: login → store cookie → GetCurrentUser → repo list all pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GetCurrentUser() was not checking the HTTP status code or the JSON
"status" field. GitLink returns {"status":401,"message":"无效token"}
as valid JSON, so json.Unmarshal succeeds and the function returns nil
error — making any token appear valid.
Now properly checks HTTP status code, JSON status field, and requires
"login" field in response. If login API tokens fail verification,
shows clear guidance to use private token (--token mode).
Root cause of Windows 401: login API returns session/CSRF token, not
a valid API access_token. The broken verification masked this entirely.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The postinstall script was only checking if the existing binary could
run (--help), not whether its version matched the npm package version.
This caused npm upgrades to skip downloading the new binary, leaving
users on stale versions without fixes.
Now checks `gitlink-cli version` output against package.json version.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Prefer autologin cookie over response body token (body token may be CSRF/session token)
- Use cookiejar to capture cookies across redirects
- Try all candidate tokens and verify each with /users/me API call
- Detect keyring store/load mismatch and auto-fallback to file storage
- Login now fails fast if no candidate token works, instead of silently storing a bad token
Fixes Windows 401 "无效token" after successful login. Also improves
reliability on headless Linux (no Secret Service) and edge cases on macOS.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- New bin/install-skills.js: resolves local skills path automatically
- Users just run `gitlink-cli-install-skills` on any platform
- No more bash-specific $(npm root -g) syntax that breaks on Windows
- Update README installation docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- When exact version release not found, fallback to latest release
- Match assets by platform/arch pattern when version in filename differs
- Ensures npm install works even when release version != npm version
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GitLink release API returns relative URLs for attachments (e.g.
/Gitlink/gitlink-cli/releases/download/...). Prepend RELEASE_BASE
to make them absolute, fixing "Invalid URL" error on Windows/Linux.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove bin/ directory from npm files, only include bin/cli.js wrapper
- postinstall now always downloads the correct platform binary from release
- Add platform compatibility check: if pre-existing binary doesn't match
current platform, re-download instead of silently failing
Fixes "cannot execute binary file" on Linux/Windows when npm package was
built on macOS.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- branch +delete: change from DELETE to POST /branches/delete with
branch_name in body (matches actual GitLink API)
- release +delete: add post-delete verification to handle API bug where
delete succeeds but returns error status
- Update branch delete skill docs: remove "known issue" notice
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add windows/amd64 and windows/arm64 to build targets with .zip packaging
- Update npm install.js: win32 platform detection, .exe binary, PowerShell zip extraction
- Update npm cli.js wrapper to append .exe on Windows
- Fix credential path to use filepath.Join for cross-platform compatibility
- Update README with Windows support docs and FAQ
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Bundle skills/ directory into npm package for local installation
- Add npx skills add instructions for both human users and AI agents
- Update README installation section to match larksuite/cli style
- Bump npm version to 0.1.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add npm package structure (package.json, install script, bin wrapper)
- Add cross-platform build script (darwin/linux × amd64/arm64)
- Add local pack script for embedding binary in npm package
- Update README with larksuite/cli-style installation docs
- Published as @gitlink-ai/cli@0.1.0 on npmjs.com
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>