cli

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli is the iap command: it gives a local CLI or an AI coding agent short-lived, host-bound credentials for hosts behind an iap-authz identity-aware proxy (default issuer https://access.iap.r167.dev). Main runs it; cmd/iap and the module root are thin package main shims.

login   register agent:user:<you>:<machine>:<program> through the browser
        (loopback + PKCE); the refresh credential goes to the OS keyring.
        One registration per program (claude under Claude Code, else cli)
curl    run curl with a freshly minted access token, passed on a pipe;
        https://api.tailscale.com via a federated token and Tailscale's
        token exchange
expose  publish 127.0.0.1:<port> at https://<name>.<domain> through the
        tunnel service behind the IAP (./expose)
status  show every program's registration (no secrets)
logout  delete one program's stored credential

No subcommand prints a token or the refresh credential. The library under it is github.com/R167/iap/iapclient; the tunnel client is github.com/R167/iap/expose.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the release version, stamped at build time with -ldflags "-X github.com/R167/iap/internal/cli.Version=v1.2.3". Unstamped, it is the module version from the build info (go install ...@v1.2.3), else "dev".

Functions

func Main

func Main() int

Main runs the iap command with os.Args and returns the process exit status: 0 on success, the status of curl or of an expose -- command when it fails, else 1. Callers pass it to os.Exit. The headless login's code prompt may itself exit with 130 or 143 on SIGINT or SIGTERM, after restoring the terminal.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL