Git Product home page Git Product logo

cli's Introduction

Afosto CLI

This tool is currently under heavy development, use with caution.

Installing

To install the CLI tool there are several options. There are no dependencies.

MacOS install / update

To install use homebrew directly from the Afosto tap.

brew tap afosto/tap
brew install afosto-cli

To upgrade:

brew upgrade afosto-cli

Features

The current list for features for this CLI tool is as follows:

  • upload a local directory to your account
  • download a remote directory (from your account) to your machine
  • develop HTML templates
  • develop JSON templates

To start local development of templates, run:

Upload files

In order to upload a directory and all it's contents from your machine to your account use the following command:

afosto upload -s /Users/peter/images -d /images

-s (source) points to the path on your computer that you want to recursively upload. -d (destination) points to the directory in your account.

By default, your files will be uploaded as public files. If you want your files to be private, use the -p or --private flag, like so:

afosto upload -s /Users/peter/images -d /images -p
afosto upload -s /Users/peter/images -d /images --private

Download files

When you want to download files from your account to your computer you run:

afosto download -s invoices -d /Users/peter/backups/invoices

-s (source) points to the directory in your account. -d (destination) points to the path on your computer that you want to store the files.

Develop templates

To start working on templates in your account you need to start the local development server while pointing to your configuration file.

afosto render -p 8888 -f afosto.config.yml

Where -p is the port number for the local webserver and -f points to the afosto.config.yml file in the root of the template repository.

Develop JSON templates

By default, the render process assumes you're rendering HTML templates. If you want to render JSON templates instead, you have to add an extra key in your config file:

config:
  - category: templates
    routes:
      - path: jsonTemplate
        output: json # The required key for JSON templates
        templatePath: path/to/your/template.tpl
        queryPath: path/to/your/query.graphql

Templating language

Pongo2 is used as the templating languages. Within the templates there are a few (hidden) powerful features / filters that might be useful.

Sort

Sort takes in a slice or a map and sort this based on a key. Start with - in order to sort in ascending order.

{{slice|sort}}
{{slice|sort:"filters.key"}}
{{slice|sort:"-filters.key"}}

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.