FocusPolaris.Cli 1.0.3

dotnet tool install --global FocusPolaris.Cli --version 1.0.3
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local FocusPolaris.Cli --version 1.0.3
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=FocusPolaris.Cli&version=1.0.3
                    
nuke :add-package FocusPolaris.Cli --version 1.0.3
                    

Polaris CLI

polarisctl is a cross-platform .NET command line tool for Polaris APIs. It runs on Windows and Linux and uses the system browser for interactive sign-in.

Install

Install the .NET 10 SDK, then install the public package from NuGet.org:

dotnet tool install --global FocusPolaris.Cli

The same command works from a Linux shell. Update and remove it with:

dotnet tool update --global FocusPolaris.Cli
dotnet tool uninstall --global FocusPolaris.Cli

Sign in

polarisctl auth login --authority https://polaris.example.com
polarisctl auth status
polarisctl auth logout

For an interactive automation workstation, expose the service secret through the process environment (for example from a CI secret store), then let the CLI save it in the OS-protected profile cache:

$env:POLARIS_SERVICE_SECRET = "<secret from your secret store>"
polarisctl auth login --authority https://polaris.example.com --client-id <SERVICE_CLIENT_ID> --client-secret-env POLARIS_SERVICE_SECRET --profile ci
polarisctl auth status --profile ci
export POLARIS_SERVICE_SECRET="$(secret-manager read polaris/service-secret)"
polarisctl auth login --authority https://polaris.example.com --client-id <SERVICE_CLIENT_ID> --client-secret-env POLARIS_SERVICE_SECRET --profile ci

The secret is not accepted as a command-line argument and is saved only in the OS-protected cache. Tokens are acquired with the OAuth client-credentials grant and refreshed by repeating that grant. Remove the stored credential with polarisctl auth logout --profile ci.

For headless CI runners, use ephemeral environment credentials instead. The CLI exchanges them for each package command and does not write either the secret or access token to disk, so this mode does not require a desktop keyring:

$env:POLARIS_AUTHORITY = "https://polaris.example.com"
$env:POLARIS_CLIENT_ID = "<SERVICE_CLIENT_ID>"
$env:POLARIS_CLIENT_SECRET = "<secret from your CI secret store>"
polarisctl package validate solution.json --base-url https://polaris.example.com
export POLARIS_AUTHORITY="https://polaris.example.com"
export POLARIS_CLIENT_ID="<SERVICE_CLIENT_ID>"
export POLARIS_CLIENT_SECRET="<secret from your CI secret store>"
polarisctl package validate solution.json --base-url https://polaris.example.com

If the API and OpenID Connect authority have different base URLs, provide both. --api-url is the API endpoint used by later commands; omitting it stores the authority URL as the API URL:

polarisctl auth login --authority https://login.example.com --api-url https://api.example.com

Use --profile NAME on auth login, auth status, auth logout, package, identity, and permissions commands to keep different accounts isolated. API commands resolve their endpoint in this order: --base-url, POLARIS_API_URL, the selected profile's saved API URL, then the local development default. A saved profile whose API URL does not match an explicit --base-url is rejected with an actionable error when that profile supplies the token. Identity, permission, and package API commands fail before making a request when no bearer token is available. The CLI does not follow API redirects to interactive login pages; it reports them as authentication or routing failures. Timed-out identity/permission calls now produce a concise diagnostic instead of a .NET stack trace.

The CLI uses Authorization Code with PKCE, opens the system browser, and receives the response on an ephemeral IPv4 loopback port. It contains no client secret.

Access and refresh tokens are stored through operating-system protected storage: Windows DPAPI or the Linux Secret Service keyring. On Linux, a desktop Secret Service such as GNOME Keyring or KDE Wallet must be available to the user session. The CLI does not fall back to plaintext token files.

NuGet.org release

The cross-platform workflow validates packing and installation on Windows and Linux. A manual run packages a selected version and uploads it as a short-lived artifact. Set publish_to_nuget only when that package is ready for public release; the publish job then pushes it to NuGet.org.

NuGet.org applies its repository signature to published packages. Polaris does not add an author signature, so a code-signing certificate is not required for this release path. Publishing uses NuGet Trusted Publishing: configure a policy for GitHub owner daoudabeye, repository polaris, and workflow polaris-cli.yml, then add the NuGet.org account username as the GitHub repository secret NUGET_USER. The workflow exchanges its GitHub OIDC identity for a short-lived NuGet publishing key; no long-lived API key is stored in GitHub.

Call the API

polarisctl package validate solution.json --base-url https://api.example.com
polarisctl package release solution.json --base-url https://api.example.com --workspace <WORKSPACE_ID> --confirm-fingerprint <SHA256>

The selected profile supplies a refreshed bearer token for its saved API URL. Set POLARIS_API_URL to override that endpoint for a session, or pass --base-url; a mismatched saved profile now fails fast instead of silently making an anonymous request. --token and POLARIS_ACCESS_TOKEN remain available for CI and short-lived automation; avoid putting durable credentials in shell history or scripts.

Identity and permissions administration

Use the signed-in administrator profile to find users and roles, inspect the server's permission grant projection, and grant or revoke one permission at a time:

polarisctl identity users list --filter daoud --take 50 --profile admin
polarisctl identity roles list --filter author --profile admin
polarisctl permissions list --user <USER_GUID> --profile admin
polarisctl permissions effective --user <USER_GUID> --profile admin
polarisctl permissions grant --role <ROLE_NAME> --permission Polaris.Authoring.ExecutePlans --profile admin
polarisctl permissions revoke --user <USER_GUID> --permission Polaris.Authoring.ExecutePlans --profile admin

For a tenant-scoped operation, pass --tenant <TENANT_GUID>. Without --yes, permission changes ask for confirmation in an interactive terminal. In scripts or redirected input, pass --yes explicitly. A service identity without the required ABP Identity and permission-management policies receives the server's authorization error; the CLI does not grant itself administrative rights.

These commands use Polaris' existing ABP Identity and Permission Management APIs, not database access. The effective view is the server's permission-management grant projection, including grant-source information returned by ABP. It is useful for explaining direct and role grants, but it is not a universal authorization simulation: object ACLs, workspace access, feature state, and business/provider restrictions still apply. The operation passes through ABP's audited application-service pipeline; do not treat CLI output or a local --reason as durable audit evidence.

Authentication limits

Interactive user sign-in and API service-principal credentials are provided by the Polaris API. Administrators can create and revoke service identities through the ApiAccess administration endpoints; the client secret is shown only once. Service tokens expire after five minutes. Revocation immediately blocks new token issuance and ApiAccess-guarded operations; an already-issued JWT remains cryptographically valid until its short expiry.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.3 116 9/28/2026
1.0.2 102 9/27/2026
1.0.1 109 9/27/2026
1.0.0 105 9/27/2026