add init and template repo function.