New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/wso2/product-apim-tooling/import-export-cli

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/wso2/product-apim-tooling/import-export-cli

  • v0.0.0-20250128115724-8b532ad8f78b
  • Source
  • Go
  • Socket score

Version published
Created
Source

CLI for Importing and Exporting APIs and Applications and Managing WSO2 Micro Integrator

For WSO2 API Manager 4.5.0

Command Line tool for importing and exporting APIs/Applications/API Products in between different API environments of WSO2 API Manager and managing WSO2 Micro Integrator

Getting Started

  • Setting up the development environment

    1. Install Go 1.22
    2. Fork the repository
    3. Clone your fork into any directory
    4. cd into cloned directory and then cd into product-apim-tooling/import-export-cli
    5. Execute go mod vendor or go mod download to download all the dependencies
    6. Run go generate ./... to pack resources
    7. Run go build apictl.go to build and test program
  • Building

    cd into product-apim-tooling/import-export-cli

    Execute ./build.sh -t apictl.go -v 4.5.0 -f to build for all platforms.

    Created packages will be available at build/target directory

  • Resources

    All the resources(Markdown files, templates etc) need to be stored inside box/resources directory You can create sub directories as you like.

    Run go generate ./... to bake your files into go files. Then refer to them using box.Get(filename). Always use relative path to resources directory with a leading slash(/)

    For example: For a file in box/resources/init/file you can retrieve it using box.Get("/init/file)

    DO NOT COMMIT blob.go to VCS

  • Generating docs

    After changing commands run following to generate documents and shell completions go run tools/gen.go

    If you need to generate docs and shell completions for MI CLI run the following MICmd=mi go run tools/migen.go

    Commit changes to version control

  • Running

    Select a generated archive suitable for your platform (Mac, Windows, Linux) and extract it to a desired location andcd into it. Then execute apictl to start the application.

    NOTE: Execute ./apictl if the working directory is the same where the executable resides

    Add the location of extracted folder to your system's $PATH variable to access the executable from anywhere

    Execute apictl --help for further instructions.

  • Adding Environments

    Add environments by either manually editing $HOME/.wso2apictl/main_config.yaml or using the command apictl add-env.

    NOTE: Directory structure for configuration files ($HOME/.wso2apictl) will be created upon execution of apictl

    Execute apictl add-env --help for detailed instructions

    The flag --environment (-e) is mandatory You can either provide only the --apim flag, or all the other 5 flags (--registration --publisher --devportal --admin --token) without providing --apim flag. If you are omitting any of --registration --publisher --devportal --admin flags, you need to specify --apim flag with the API Manager endpoint. To add a micro integrator instance to an environment you can use the --mi flag.

  • Command Autocomplete

    Copy the file shell-completions/apictl_bash_completion.sh to /etc/bash_completion.d/ and source it with source /etc/bash_completion.d/apictl_bash_completion.sh to enable bash auto-completion.

  • Building a Docker Image of APICTL

    Usage: docker build --build-arg version=<version> -t apictl:<version> .

    Example: docker build --build-arg version=4.5.0.1 -t apictl:4.5.0.1 .

    • Using the Docker Image

      docker run -it -v $(pwd):/git -v ~/.wso2apictl:/root/.wso2apictl -v ~/.wso2apictl.local:/root/.wso2apictl.local apictl:4.5.0.1 <apictl command>


Command reference

A reference for all commands can be found in here

FAQs

Package last updated on 28 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc