storctl

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 3 Imported by: 0

README

storctl

storctl is a command-line tool for managing and interacting with the STOR object store. It provides essential functionality for managing objects and buckets with a simple, intuitive interface.


Features

  • List buckets: View available buckets.
  • Create buckets: Add new storage buckets.
  • Remove buckets: Delete empty buckets.
  • List objects: Browse contents of a bucket.
  • Copy objects: Transfer objects between locations.
  • Move objects: Relocate objects across buckets or paths.
  • Remove objects: Delete specific objects from buckets.

Installation

From Source
  1. Ensure you have Go installed (version 1.23 or higher).
  2. Clone the repository:
    git clone https://github.com/cfichtmueller/storctl.git
    
  3. Build the binary using the Makefile:
    cd storctl
    make binary
    
  4. Move the binary to a directory in your PATH (e.g., /usr/local/bin).

Usage

storctl commands follow the syntax:

storctl <command> [arguments] [options]
Commands and Examples
List buckets (lb)
storctl lb

Example:

storctl lb 
# Output:
# NAME           OBJECTS   SIZE
# mybucket       8         1405614
# another-bucket 3         3160277
Create a bucket (mb)
storctl mb <bucket>

Example:

storctl mb newbucket
Remove a bucket (rb)
storctl rb <bucket>

Example:

storctl rb oldbucket
List objects (ls)
storctl ls <bucket>

Example:

storctl ls mybucket
# Output:
# file1.txt
# file2.txt
Copy an object (cp)
storctl cp <source> <destination>

Example:

storctl cp stor://mybucket/file1.txt stor://mybucket-backup/file1.txt
storctl cp file1.txt stor:///mybucket/file1.txt
Move an object (mv)
storctl mv <source> <destination>

Example:

storctl mv stor://mybucket/file1.txt stor://mybucket-archive/file1.txt
Remove an object (rm)
storctl rm <bucket> <key>

Example:

storctl rm mybucket file1.txt
Configuration Management Commands
  • Create a configuration context:
    storctl config create-context <context-name>
    
  • Delete a configuration context:
    storctl config delete-context <context-name>
    
  • List all configuration contexts:
    storctl config get-contexts
    
  • Rename a configuration context:
    storctl config rename-context <old-name> <new-name>
    
  • Set credentials in a context:
    storctl config set-credentials <context-name> --api-key <key>
    
  • Use a specific configuration context:
    storctl config use-context <context-name>
    
Initial Configuration

When you first run storctl, an empty configuration file is created automatically in your home directory. Use the config commands above to manage your configuration contexts.


License

This project is licensed under the MIT License. See the LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
cp
lb
ls
mb
mv
rb
rm

Jump to

Keyboard shortcuts

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