@nu-art/commando
Version:
Shell command execution framework with interactive sessions, CLI parameter resolution, and plugin system for building and executing shell scripts programmatically
151 lines (150 loc) • 4.47 kB
TypeScript
import { Commando_Programming } from './programming.js';
import { Commando_Basic } from './basic.js';
import { BaseCommando } from '../core/BaseCommando.js';
declare const Super: import("@nu-art/ts-common").Constructor<BaseCommando & Commando_Programming & Commando_Basic>;
type GitCloneParams = {
outputFolder?: string;
branch?: string;
recursive?: boolean;
};
type GitPushParams = {
remote: string;
branch: string;
tags?: boolean;
force?: boolean;
};
/**
* Git operations plugin for Commando.
*
* Provides Git command methods via a fluent API. Extends Commando_Programming
* and Commando_Basic (merged via class-merger).
*
* **Usage**: Access via `git()` method which returns an object with all
* Git operations. Methods build commands but don't execute them until
* `execute()` is called.
*
* **Operations**:
* - Repository operations: clone, fetch, pull, push
* - Branch operations: checkout, create, merge, get current
* - Commit operations: add, commit, addAndCommit
* - Tag operations: create, push
* - Utility: status, resetHard, gsui (git status UI)
*/
export declare class Commando_Git extends Super {
/**
* Clones a Git repository.
*
* @param url - Repository URL to clone
* @param options - Optional clone parameters (branch, recursive, output folder)
* @returns This instance for method chaining
*/
git_clone(url: string, options?: GitCloneParams): this;
/**
* Checks out a branch.
*
* @param branch - Branch name to checkout
* @returns This instance for method chaining
*/
git_checkout(branch: string): this;
/**
* Creates or updates a tag (force).
*
* @param tagName - Tag name to create/update
* @returns This instance for method chaining
*/
git_createTag(tagName: string): this;
/**
* Commits changes with a message.
*
* @param commitMessage - Commit message
* @returns This instance for method chaining
*/
git_gitCommit(commitMessage: string): this;
/**
* Stages a specific file.
*
* @param file - File path to stage
* @returns This instance for method chaining
*/
git_add(file: string): this;
/**
* Stages all files in the current directory.
*
* @returns This instance for method chaining
*/
git_addAll(): this;
/**
* Stages all files and commits with a message.
*
* @param commitMessage - Commit message
* @returns This instance for method chaining
*/
git_addAndCommit(commitMessage: string): this;
/**
* Pushes to a remote branch.
*
* @param options - Push parameters (remote, branch, tags, force)
* @returns This instance for method chaining
*/
git_push(options?: GitPushParams): this;
/**
* Pushes all tags to remote (force).
*
* @returns This instance for method chaining
*/
git_pushTags(): this;
/**
* Fetches from remote.
*
* @returns This instance for method chaining
*/
git_fetch(): this;
/**
* Resets repository to a specific tag/commit (hard reset).
*
* @param tag - Optional tag or commit hash (default: empty string)
* @returns This instance for method chaining
*/
git_resetHard(tag?: string): this;
/**
* Gets the current branch name.
*
* @returns This instance for method chaining
*/
git_getCurrentBranch(): this;
/**
* Pulls from remote with optional parameters.
*
* @param params - Optional pull parameters
* @returns This instance for method chaining
*/
git_pull(params: string): this;
/**
* Merges a branch into the current branch.
*
* @param mergeFrom - Branch to merge from
* @returns This instance for method chaining
*/
git_merge(mergeFrom: string): this;
/**
* Creates a new branch and sets upstream.
*
* @param branch - Branch name to create
* @returns This instance for method chaining
*/
git_createBranch(branch: string): this;
/**
* Updates git submodules (recursive, init if needed).
*
* @param modules - Optional module paths (default: empty string)
* @returns This instance for method chaining
*/
git_gsui(modules?: string): this;
/**
* Shows git status.
*
* @returns This instance for method chaining
*/
git_status(): this;
}
export {};