cli

package
v0.0.0-...-edd9e21 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(version string)

Main is invoked from cmd/yandex-cli/main.go.

func Run

func Run(args []string, version string, stdout, stderr io.Writer, stdin io.Reader) (exit int)

Run parses argv and dispatches to the matched command. Returns the exit code.

Types

type BodyInput

type BodyInput struct {
	Body     string `name:"body" help:"page body inline" xor:"body"`
	BodyFile string `name:"body-file" help:"page body from file ('-' for stdin)" xor:"body"`
}

func (BodyInput) Read

func (b BodyInput) Read(stdin io.Reader) (string, error)

type CLI

type CLI struct {
	JSON bool `name:"json" help:"emit JSON instead of plain text"`

	Tracker TrackerCmd `cmd:"" help:"Yandex Tracker (read)"`
	Wiki    WikiCmd    `cmd:"" help:"Yandex Wiki (read+write)"`

	Version VersionCmd `cmd:"" help:"print version"`
}

CLI is the root kong struct.

type CreatePageCmd

type CreatePageCmd struct {
	Slug           string `name:"slug" required:"" help:"target slug"`
	Title          string `name:"title" required:"" help:"page title"`
	AttachmentsDir string `` /* 130-byte string literal not displayed */
	BodyInput
}

func (*CreatePageCmd) Run

func (c *CreatePageCmd) Run(g *Globals) error

type DeleteAttachmentCmd

type DeleteAttachmentCmd struct {
	PageSlug string `arg:"" name:"page-slug" help:"page slug"`
	Filename string `arg:"" name:"filename" help:"attachment filename"`
}

func (*DeleteAttachmentCmd) Run

func (c *DeleteAttachmentCmd) Run(g *Globals) error

type DownloadAttachmentCmd

type DownloadAttachmentCmd struct {
	PageSlug string `arg:"" name:"page-slug" help:"page slug"`
	Filename string `arg:"" name:"filename" help:"attachment filename"`
	Output   string `name:"output" default:"-" help:"output path; '-' for stdout"`
}

func (*DownloadAttachmentCmd) Run

func (c *DownloadAttachmentCmd) Run(g *Globals) error

type DownloadTrackerAttachmentCmd

type DownloadTrackerAttachmentCmd struct {
	Key    string `arg:"" help:"issue key (e.g. FOO-1)"`
	ID     string `arg:"" help:"attachment id (from 'tracker attachments list')"`
	Output string `name:"output" default:"-" help:"output path; '-' for stdout"`
}

func (*DownloadTrackerAttachmentCmd) Run

type GetIssueCmd

type GetIssueCmd struct {
	Key string `arg:"" help:"issue key (e.g. FOO-1)"`
}

func (*GetIssueCmd) Run

func (c *GetIssueCmd) Run(g *Globals) error

type GetPageCmd

type GetPageCmd struct {
	Slug           string `arg:"" help:"page slug (e.g. team/notes/2026-04-29)"`
	Output         string `name:"output" help:"write raw page content to file ('-' for stdout); default: stdout via Plain rendering"`
	AttachmentsDir string `` /* 171-byte string literal not displayed */
}

func (*GetPageCmd) Run

func (c *GetPageCmd) Run(g *Globals) error

type GetQueueCmd

type GetQueueCmd struct {
	Key string `arg:"" help:"queue key"`
}

func (*GetQueueCmd) Run

func (c *GetQueueCmd) Run(g *Globals) error

type Globals

type Globals struct {
	JSON   bool
	Stdout io.Writer
	Stderr io.Writer
	Stdin  io.Reader
	Ctx    context.Context
}

Globals carries cross-command state injected via kong.Bind.

func (*Globals) Format

func (g *Globals) Format() render.Format

type ListAttachmentsCmd

type ListAttachmentsCmd struct {
	PageSlug string `arg:"" name:"page-slug" help:"page slug"`
}

func (*ListAttachmentsCmd) Run

func (c *ListAttachmentsCmd) Run(g *Globals) error

type ListIssuesCmd

type ListIssuesCmd struct {
	Queue string `name:"queue" help:"queue key (e.g. FOO)"`
	Query string `name:"query" help:"Tracker query language string"`
}

func (*ListIssuesCmd) Run

func (c *ListIssuesCmd) Run(g *Globals) error

type ListPagesCmd

type ListPagesCmd struct {
	Parent string `name:"parent" required:"" help:"parent slug to list children of"`
}

func (*ListPagesCmd) Run

func (c *ListPagesCmd) Run(g *Globals) error

type ListQueuesCmd

type ListQueuesCmd struct{}

func (*ListQueuesCmd) Run

func (c *ListQueuesCmd) Run(g *Globals) error

type ListTrackerAttachmentsCmd

type ListTrackerAttachmentsCmd struct {
	Key string `arg:"" help:"issue key (e.g. FOO-1)"`
}

func (*ListTrackerAttachmentsCmd) Run

type ListTrackerCommentsCmd

type ListTrackerCommentsCmd struct {
	Key string `arg:"" help:"issue key (e.g. FOO-1)"`
}

func (*ListTrackerCommentsCmd) Run

type TrackerAttachmentsCmd

type TrackerAttachmentsCmd struct {
	List     ListTrackerAttachmentsCmd    `cmd:"" help:"list attachments on an issue"`
	Download DownloadTrackerAttachmentCmd `cmd:"" help:"download an attachment by issue key + id"`
}

type TrackerCmd

type TrackerCmd struct {
	Issues      TrackerIssuesCmd      `cmd:"" help:"issues"`
	Queues      TrackerQueuesCmd      `cmd:"" help:"queues"`
	Comments    TrackerCommentsCmd    `cmd:"" help:"issue comments"`
	Attachments TrackerAttachmentsCmd `cmd:"" help:"issue attachments (issue-level and comment-level, unified)"`
}

type TrackerCommentsCmd

type TrackerCommentsCmd struct {
	List ListTrackerCommentsCmd `cmd:"" help:"list comments on an issue"`
}

type TrackerIssuesCmd

type TrackerIssuesCmd struct {
	List ListIssuesCmd `cmd:"" help:"list issues by queue or query"`
	Get  GetIssueCmd   `cmd:"" help:"get an issue by key"`
}

type TrackerQueuesCmd

type TrackerQueuesCmd struct {
	List ListQueuesCmd `cmd:"" help:"list queues"`
	Get  GetQueueCmd   `cmd:"" help:"get a queue by key"`
}

type UpdatePageCmd

type UpdatePageCmd struct {
	Slug           string `arg:"" help:"page slug"`
	AttachmentsDir string `` /* 156-byte string literal not displayed */
	BodyInput
}

func (*UpdatePageCmd) Run

func (c *UpdatePageCmd) Run(g *Globals) error

type UploadAttachmentCmd

type UploadAttachmentCmd struct {
	PageSlug string `arg:"" name:"page-slug" help:"page slug"`
	File     string `name:"file" required:"" help:"local file path to upload"`
	Name     string `name:"name" help:"attachment filename (defaults to basename of --file)"`
}

func (*UploadAttachmentCmd) Run

func (c *UploadAttachmentCmd) Run(g *Globals) error

type VersionCmd

type VersionCmd struct{}

func (VersionCmd) Run

func (VersionCmd) Run(g *Globals, version string) error

type WikiAttachmentsCmd

type WikiAttachmentsCmd struct {
	List     ListAttachmentsCmd    `cmd:"" help:"list attachments on a page"`
	Upload   UploadAttachmentCmd   `cmd:"" help:"upload a file to a page"`
	Download DownloadAttachmentCmd `cmd:"" help:"download an attachment by page slug + filename"`
	Delete   DeleteAttachmentCmd   `cmd:"" help:"delete an attachment by page slug + filename"`
}

type WikiCmd

type WikiCmd struct {
	Pages       WikiPagesCmd       `cmd:"" help:"pages"`
	Attachments WikiAttachmentsCmd `cmd:"" help:"page attachments"`
}

type WikiPagesCmd

type WikiPagesCmd struct {
	List   ListPagesCmd  `cmd:"" help:"list page descendants by parent slug"`
	Get    GetPageCmd    `cmd:"" help:"get a page by slug"`
	Create CreatePageCmd `cmd:"" help:"create a page"`
	Update UpdatePageCmd `cmd:"" help:"update a page body"`
}

Jump to

Keyboard shortcuts

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