Code Monkey home page Code Monkey logo

example-starter-plugin's Introduction

Example Deepgram CLI Plugin Template

A template repo for creating a Deepgram CLI Plugin.

Create a New Repo Using This Template (Well, Not Really)

Ideally, the easier way of creating a Deepgram CLI Plugin would be to use this repo template as a starting point. The reality is that this wwon't be the normal workflow for creating a template. The typical use case will probably be:

  1. Some creates a "thing" OR a "project" already exists.
  2. It would be nice for this "thing" to have a plugin.

Because of this, starting a project using this template probably won't be the way people get started.

Having said that, I think you could git clone this repo and the copy over the scaffolding that exists into your repo and open a PR to include it. Since this will probably be the path for inclusion, the documentation will focus on this method instead.

Using the Example CLI

Build the Plugin

When you create a Deepgram CLI plugin, you are effectively creating a Go plugin or in more basic terms, a shared library/object; hence, the so extension on the resulting file.

To read more about Go plugin, take a look at this simple blog.

To build your plugin:

cd ./pkg/plugin
go build -buildmode=plugin -ldflags="-s -w" -v

IMPORTANT: You need to have build mechanisms (ie a Makefile for example) to orchestrate making the binaries for all your target platforms (macOS x86, macOS arm64, Linux amd64, etc, etc).

Using the CLI Locally

Once you create the .so, you can also use this repo as example to build a standalone plugin without requiring the Deepgram CLI.

To build a CLI for just your project, run:

cd ./cmd/plugin
cp ../../pkg/plugin/plugin.so ./
go run main.go

This will generate an executable that requires no external dependencies (ie everything is statically linked) and packaged with the .so, you have a standalone CLI for your project.

Development and Contributing

Interested in contributing? We ❤️ pull requests!

To make sure our community is safe for all, be sure to review and agree to our Code of Conduct. Then see the Contribution guidelines for more information.

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

Further Reading

Check out the Developer Documentation at https://developers.deepgram.com/

example-starter-plugin's People

Watchers

 avatar  avatar

Forkers

dvonthenen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.