cli

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(cmd *AddCmd, keys keyrings.Keys) (string, error)

func AddMigration

func AddMigration(migrationUri string, keys keyrings.Keys) (string, error)

func Code

func Code(cmd *CodeCmd, keys keyrings.Keys) (string, error)

func Copy

func Copy(cmd *CopyCmd, keys keyrings.Keys) (string, error)

func Decode

func Decode(cmd *DecodeCmd) (string, error)

func Gen added in v0.1.2

func Gen(cmd *GenCmd) (string, error)

func IsMigrationUri

func IsMigrationUri(uri string) bool

func List

func List(cmd *ListCmd, keys keyrings.Keys) (string, error)

func Remove

func Remove(cmd *RemoveCmd, keys keyrings.Keys) (string, error)

func ScanQrCode

func ScanQrCode(cmd *ScanCmd) (string, error)

func SetCounter

func SetCounter(cmd *SetCounterCmd, keys keyrings.Keys) (string, error)

func View

func View(cmd *ViewCmd, keys keyrings.Keys) (string, error)

Types

type AddCmd

type AddCmd struct {
	Uri    string `arg:"positional,required"`
	Name   string `arg:"--name" help:"Optional name of the code to refer to it later"`
	IsCode bool   `arg:"--code" help:"Pass just secret code instead of full URI"`
	Hash   string `arg:"--hash" help:"Hash algorithm SHA-1, SHA-256 or SHA-512" choice:"SHA-1" choice:"SHA-256" choice:"SHA-512"`
}

type CodeCmd

type CodeCmd struct {
	Name    string `arg:"positional,required" help:"Name of the OTP code"`
	Counter int64  `arg:"--counter" help:"Override counter for the HOTP code"`
	Copy    bool   `arg:"-c,--copy" help:"Copy generated code to clipboard"`
}

type CopyCmd

type CopyCmd struct {
	Name    string `arg:"positional,required" help:"Name of the OTP code"`
	Counter int64  `arg:"--counter" help:"Override counter for the HOTP code"`
}

type DecodeCmd

type DecodeCmd struct {
	Uri   string `arg:"positional,required" help:"Google Authenticator Export URI"`
	Parse bool   `arg:"-p,--parse" help:"Parse URIs and print each part separately"`
}

type GenCmd added in v0.1.2

type GenCmd struct {
	Key    string `arg:"--key" help:"Base32-encoded secret key" required:"true"`
	Hash   string `arg:"--hash" help:"Hash algorithm SHA-1, SHA-256 or SHA-512" choice:"SHA-1" choice:"SHA-256" choice:"SHA-512" default:"SHA-1"`
	Digits int    `arg:"--digits" help:"Number of digits in the code, 6-10" default:"6"`
	Period uint   `arg:"--period" help:"TOTP code rotation period, default is 30 seconds" default:"30"`
}

type ListCmd

type ListCmd struct {
}

type RemoveCmd

type RemoveCmd struct {
	Name string `arg:"positional,required" help:"Name of the code to remove"`
}

type ScanCmd

type ScanCmd struct {
	Image  string `arg:"positional,required" help:"Image with the QR Code"`
	Decode bool   `arg:"-d,--decode" help:"Decode otpauth-migration URI retrieved from the QR code"`
	Parse  bool   `arg:"-p,--parse" help:"For decoded migration URIs, parse them and print each part separately"`
}

type SetCounterCmd

type SetCounterCmd struct {
	Name    string `arg:"positional,required" help:"HOTP code name"`
	Counter int64  `arg:"positional,required" help:"New counter value"`
}

type ViewCmd

type ViewCmd struct {
	Name string `arg:"positional,required" help:"Name of the OTP code to view"`
}

Jump to

Keyboard shortcuts

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