Giter Site home page Giter Site logo

archer's Introduction

Archer

Rails console history for Heroku, Docker, and more

Screenshot

Designed for platforms with ephemeral filesystems

Installation

Add this line to your application’s Gemfile:

gem "archer-rails"

And run:

rails generate archer:install
rails db:migrate

Lastly, update your Gemfile to only include it in environments where you need it:

gem "archer-rails", group: [:production]

How It Works

Ruby stores console history in a file specified by:

IRB.conf[:HISTORY_FILE]

This file gets lost on ephemeral filesystems. Instead, we store its contents in the database.

Users

Each user can keep their own history. The user determined by ENV["USER"] by default. You can specify a user when starting the console with:

USER=andrew rails console

Confirm it worked with:

Archer.user

Clearing History

Disable saving history for the current session with:

Archer.save_session = false

You should do this when running sensitive commands.

Clear history for current user with:

Archer.clear

Configuration

Change the number of commands to remember

Archer.limit = 200 # default

Change how the user is determined

Archer.user = ENV["USER"] # default

Platform Notes

Heroku

For user-specific history, the command should follow this format:

heroku run USER=andrew rails console

Set up an alias to save yourself some typing

alias hc="heroku run USER=andrew rails console"

Dokku

There’s no way to specify a user at the moment.

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/archer.git
cd archer
bundle install

archer's People

Contributors

ankane avatar

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.