GithubHelp home page GithubHelp logo

cli's Introduction

BeCode: CLI

⚙️ CLI Utils at BeCode. Useful for everyone.


npm version License: MIT GitHub Issues


BeCode CLI is a command-line based util, with useful tools to automate some of your dev tasks at BeCode.

About

Junior or Coach, introducing BeCode CLI: a small util tool, giving you some great commands without leaving your terminal.
For now, this tool allows you to navigate to our different GitHub repositories, generate complete docker dev environments or generate README.md files according to BeCode standards.

But remember: BeCode CLI is yours. Feel free to contribute, add new features or requests new ones.

Use cases

Generating docker environment for your projects

The BeCode CLI can generate a docker-compose.yml file to handle the dev env for your project.
Simply run becode generate env from inside a git repository and answer the questions.

You can either install predefined application environment (like Wordpress, Drupal, Ghost…), or build a custom environment, by choosing your main language, your database and tools.

The BeCode CLI will generate two files: a complete, ready-to-use docker-compose.yml file ; and a docker-readme.md file, containing all the information about docker (how to install and configure), and the containers of your app.

Generating complete README.md template files

The BeCode CLI can generate a README.md respecting our internal guidelines.

Simply run becode generate readme from inside a git repository and answer the questions.


Installation

You must have node.js installed on your machine.

Simply run the following command to install the BeCode CLI:

npm install -g @becode/cli

Usage

The command use this syntax:

becode [command] [args...]

If you need help, use the help command:

becode --help

🤟 Recommanded: use npx

While the command can be a bit longer, it's better to use npx instead of installing packages globally.

To do so, instead of using becode command, use npx @becode/cli:

npx @becode/cli [command] [args...]

Available commands

configure

becode configure

Ask you some questions to setup the cli tool.
Should be run once, possibly right after installing the cli tool.

open

becode open [target] [...options]

Open the selected target in your default browser.

Available targets
  • central: open the Central repository
  • watch: open the Watch repository
  • promo: open the repository of your promo - you must have run the command configure once before
  • github: open your GitHub profile (or, if you haven't configured your tool, the GitHub homepage)
  • my or mybecode: open the MyBeCode platform
Available options
  • -c --choose : Choose promo in a list instead of using the configured one

generate

becode generate [target] [...options]

Use interactive process to generate useful files for your projects.

Available targets
  • readme: generate a README.md file that conforms with the BeCode's conventions
  • ignore: generate a common .gitignore file
  • env: generate a docker compose env, after some questions
Available options
  • -o <path>, --output <path> : Generate target files at specified path (defaults to current git repo root) - not supported for the ignore target

Contribute

Feel free to hack the tool, suggest any modification and/or implement it by yourself and submit a pull request !

The contribution guide is in the CONTRIBUTING.md file.

Any idea? Suggestions?

You don't want (or can't) help, but you have some ideas to improve BeCode CLI?
Please, create an issue and tell us everything.


October 2018, leny@BeCode. Licensed under the MIT License.

cli's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar farid212 avatar leny avatar ludovicpatho avatar nicolas-van avatar nicolasjamar avatar pixeline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

✨ Create binded volume folders

On linux (and maybe Windows, don't know), when docker is creating binded volume's folders, they are created as root user, which cause many problems.
It can be a good idea to generate these folders (if they not exits).

Also, add a --no-volume-scaffolding option to avoid the behavior.

"becode help" returns nothing

Describe the bug
typing becode helpdoes not retun anything. Nor any other command.

Screenshots
Capture d'écran 2019-05-17 12 41 53

Desktop (please complete the following information):

  • OS: Mac OS X 10.14.4

💫 Refactor configure / login to graph API

When the graphAPI coming to production, it will be better to hook the cli to the graph API.

The cli will become a client, and will not need to be a second source of data.

The primary goal is to allow becode users to log into the API from the cli, then we will be able to replicate some mybecode actions from the cli (we already have the needs for some coaches).

TODO

  • Remove the configure command
  • Implement the following commands:
    • login (use the graph API loginWithGitHub mutation)
      • To implement OAuth2, use a local koa instance to handle the return URL
    • logout (use the graph API revoke mutation)
  • save the token in ~/.becode.cli.json file
  • refactor open command to use the graph API data

📑 Generate PDF exports of promo's timesheet

Asked by @LudovicPatho - they need to generate pdf exports of timesheets for the FOREM.

The new underlying structure of graph/mybecode makes the operation quite complex to perform online (configuring lambda to generate pdf), while, with the cli, we can get the data (after the #24 refactor), generate local html pages, then export to pdf, using the hardware of the user.

Command Process

⚠ only for coaches and EMO

  • Select promo
  • Select date range (start and end)
  • Generate html pages
  • Export to pdf (two npm packages seems useful: pdfmake & pdfkit)

⬆️ Update dependencies

Package                                    Current  Wanted  Latest  Location
@babel/cli                                   7.1.5   7.2.3   7.2.3  @becode/cli
@babel/core                                  7.1.6   7.3.3   7.3.3  @becode/cli
@babel/plugin-proposal-object-rest-spread    7.0.0   7.3.2   7.3.2  @becode/cli
@babel/preset-env                            7.1.6   7.3.1   7.3.1  @becode/cli
chalk                                        2.4.1   2.4.2   2.4.2  @becode/cli
enquirer                                     2.0.7   2.3.0   2.3.0  @becode/cli
eslint                                       5.9.0  5.14.1  5.14.1  @becode/cli
eslint-plugin-prettier                       3.0.0   3.0.1   3.0.1  @becode/cli
husky                                        1.1.4   1.3.1   1.3.1  @becode/cli
lint-staged                                  8.0.4   8.1.4   8.1.4  @becode/cli
luxon                                        1.6.2  1.11.3  1.11.3  @becode/cli
prettier                                    1.15.2  1.16.4  1.16.4  @becode/cli

not having to specify a promotion :)

Is your feature request related to a problem? Please describe.
It asks me to specify a promotion, but i have all. no idea if this is going to be limiting me further down the line.
Describe the solution you'd like
would it be ok for you to have a "i'll do it later" option ?

thanks !

🐞open central when i select watch

Describe the bug
When i select the watch repo with the open command it open me the central repo.

To Reproduce
Steps to reproduce the behavior:

  1. type command: becode open
  2. Then select watch
  3. It open the central repo

Expected behavior
I expected that open the watch's repo

Screenshots
Capture d’écran 2019-05-20 à 00 29 01

Desktop (please complete the following information):

  • OS: Ios
  • Browser: Firefox dev édition

Additional context
I selected watch option with arrows and return

📝 Referencing the docker survival guide

@nicolas-van has created a docker survival guide, currently hosted on the private syllabus repo.
It will be great to add a link to it inside the generated docker-readme.md from the generate env command.

TODO

  • @nicolas-van create a public gist with the guide
  • @leny reference the guide in the generated docker-readme.md

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.